How Translation Works

Best understood by looking at this schematic:

../../../_images/MappingScheme.png

Step-by-step:

  1. The edi file is lexed and parsed using the grammar.
  2. The message is transformed into a tree structure. This is similar to the use of DOM in xml. Advantages:
    • Easy access to message content. This is quite similar to XML-queries or X-path.
    • Choose the logic for the mapping script that is best fit for the situation - instead of being forced to ‘loop’ over incoming message.
    • Sorting: eg. sort article lines by article number.
    • Counting: eg. count number of lines, total amounts etc
    • Access the data you already written in the tree
  3. Split the edi file into separate messages (eg one edi file can contain multiple orders).
  4. Find the right translation for message.
  5. Run the mapping script for message.
  6. Serialize the outmessage-tree to file. This is checked and formatted according to the grammar of the outgoing message.
  7. Outgoing messages are enveloped and/or merged.