Problem
Currently we are running software from Seeburger company to transform e.g Edifact to iDoc. Therefore a lot of mapping files exist to describe this transformation in a proprietary language SEEXML. It has a file ending xml but it has just a bunch of XML tags (name, NewMapping,sourceMessages, destinationMessage) and it's own language in this textline tags:
Now the goal is to:
- transform this mapping into something else (Java/XSLT/own DSL/...)
- execute the tranformation (e.g. EDI to iDoc) with new own mapping.
This is how a SEEXML mapping file looks like:
...
</textline>
<textline>//Variables part start
</textline>
<textline>
</textline>
<textline>global UNB_TIME$;
</textline>
<textline>global UNB_DATE$;
</textline>
<textline>global SNDPOR$;
...
</textline>
<textline>IF IsWorkFlowActive() = true
</textline>
<textline> Copy getInputValue("OWN.USER.ARCHIVE.SOURCE.FILE.IDENT") to ARCKEY$;
...
<recordMapping>
<fullname>UNB#1.UNH#1.G01#1.NAD#1</fullname>
<textline>// fill buyer details
</textline>
<textline>IF Trim(UNB.UNH.G01.NAD:3035) = "PE"
</textline>
<textline> Copy Trim(UNB.UNH.G01.NAD:C082.3039) to PE_PARTNER$;
...
<destinationMessages>
<destinationMessage kind="3">
<name>EXAMPLE_DEST</name>
</destinationMessage>
</destinationMessages>
</mapping>
I have also a reference for this language (BIC Mapping Designer Command
Reference) describing the commands like copy
, trim
and the path syntax (´UNB.UNH.G01.NAD:3035´)
Ideas
- XSLT: First idea which cam into my mind was XSLT. Transformation of the mapping will be hard but execution is easy as there are frameworks for file transformation. Problem is here how to get this SEEXML to XSLT. Also for further adaptions XSLT is not that easy to master
- Java: transform this mapping file to plain Java.
Questions
- Any suggestions here beside parsing strings from SEEXML to java?
- I would call this SEEXML a DSL.
- Are there frameworks to describe the language and transfer it to Java later on?
- Is ANTLR or JetBrains MPS capable of transforming the DSL to Java?