Last modified by Erik Bakker on 2024/09/03 08:01

Hide last authors
Erik Bakker 2.1 1 {{container}}{{container layoutStyle="columns"}}(((
Erik Bakker 14.1 2 This micro-learning will focus the tranformation from EDI to an XML message. EDI (Electronic Data Interchange) is a very specific format of a message that can be interpreted by some systems. Rather than providing XML tags or curly JSON brackets, you will find a flat file that is very well organized but uses lots or abbreviations or tags to identify entities and attributes in the message. This microlearning will explain more around these structures and how to create such EDI messages when you have an XML prepared.
eMagiz 1.1 3
Erik Bakker 2.1 4 Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]].
eMagiz 1.1 5
6 == 1. Prerequisites ==
7
Erik Bakker 4.1 8 * Intermediate knowledge of the eMagiz platform
9 * Good working experience in the Create phase and transformations.
eMagiz 1.1 10
11 == 2. Key concepts ==
12
Erik Bakker 4.1 13 An example of an EDI message is listed below. Each line starts with a tag that indicates the meaning of the line, and each message starts with fixed starting tags (UNA) and fixed ending tags (UNZ).
eMagiz 1.1 14
Erik Bakker 4.1 15 [[image:Main.Images.Microlearning.WebHome@advanced-create-your-transformations-xml-2-edi-1.png]]
eMagiz 1.1 16
Erik Bakker 4.1 17 There are a lot of different versions of EDI each indicated with version id. A commonly used version is D96A, while versions D01B, D95A, D01A, etc exists. It's important to understand upfront what the version used is from the client, allthough the EDI message itself contains that information. The example above is a D01B version - see 3rd line. Within each version of EDI there is a specific type of data exchanged. Such as orders, invoices, confirmations, etc. In the example above this is an ORDERS message. Each of the version and data type combination has a specific message definition that is required to obtain in order to create the System Message.
eMagiz 1.1 18
Erik Bakker 5.1 19 == 3. Transforming XML to EDI messages (and vice versa) ==
eMagiz 1.1 20
Carlijn Kokkeler 10.1 21 The important part of generating the System Message for the EDI message is to create the XML structure of that specific EDI message type. The basis for the System definition is the XML structure that is generated from an EDI message or the structure to create an XML with. Using the EDI version and the message type inside the EDI message, components eMagiz will create the associated XML or EDI structure for you. Once you have this, you can then use that XML as the basis for your System Definition. This is the basis for the System Message validation in your process.
eMagiz 1.1 22
Erik Bakker 5.1 23 === 3.1 XML to EDI transformation model component ===
eMagiz 1.1 24
Erik Bakker 5.1 25 eMagiz has standard model components in the create phase available that can convert an EDI messages to an XML message. Below the screenshots of the model component. The important parameter here is which EDI version is used here.
eMagiz 1.1 26
Erik Bakker 5.1 27 [[image:Main.Images.Microlearning.WebHome@advanced-create-your-transformations-xml-2-edi-2.png]]
eMagiz 1.1 28
Erik Bakker 5.1 29 Please note that you need to put the XML structure in the namespace of this transformation model component: urn:org.milyn.edi.unedifact.v41. The message type XML tag (DESADV, ORDER, etc) does not need to be prefixed.
Carlijn Kokkeler 7.1 30
31 {{code language="xml"}}
Erik Bakker 5.1 32 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
33 <xsl:output omit-xml-declaration="yes" indent="yes"/>
34 <xsl:strip-space elements="*"/>
35 <xsl:template match="node()|attribute()">
36 <xsl:copy>
37 <xsl:apply-templates select="node()|attribute()"/>
38 </xsl:copy>
39 </xsl:template>
40 <xsl:template match="*[not(ancestor-or-self::DESADV)]">
41 <xsl:element name="ns:{local-name()}" namespace="urn:org.milyn.edi.unedifact.v41">
42 <xsl:apply-templates select="node()|attribute()"/>
43 </xsl:element>
44 </xsl:template>
45 </xsl:stylesheet>
Carlijn Kokkeler 7.1 46 {{/code}}
eMagiz 1.1 47
Erik Bakker 5.1 48 === 3.2 EDI to XML transformation model component ===
eMagiz 1.1 49
Erik Bakker 5.1 50 As the previous section, but the other EDI model component needs to be selected. See below for a screenshot of that component.
eMagiz 1.1 51
Erik Bakker 5.1 52 [[image:Main.Images.Microlearning.WebHome@advanced-create-your-transformations-xml-2-edi-3.png]]
eMagiz 1.1 53
Erik Bakker 5.1 54 === 3.3 File type best practise ===
eMagiz 1.1 55
Erik Bakker 5.1 56 * In the event you receive an EDI, don't create any file to string alike transformation. Directly transform the file from EDI to XML
57
Eva Torken 12.1 58 == 4. Key takeaways ==
eMagiz 1.1 59
Erik Bakker 4.1 60 eMagiz is able to transform messages from XML to EDI
eMagiz 1.1 61
Erik Bakker 4.1 62 * Use the proper components to transform the message to the right EDI format
63 * Validate the XML structure before it's transformed to an EDI message (outgoing)
eMagiz 1.1 64
Eva Torken 12.1 65 == 5. Suggested Additional Readings ==
eMagiz 1.1 66
Carlijn Kokkeler 13.1 67 * [[Advanced (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Advanced Level.WebHome||target="blank"]]
68 ** [[Create your transformations (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Advanced Level.Create your transformations.WebHome||target="blank"]]
69 *** [[Transform EDI to XML (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Advanced Level.Create your transformations.advanced-create-your-transformations-edi-2-xml-exercise.WebHome||target="blank"]]
Erik Bakker 14.1 70 * [[EDI (Search Result)>>url:https://docs.emagiz.com/bin/view/Main/Search?sort=score&sortOrder=desc&highlight=true&facet=true&r=1&f_space_facet=0%2FMain.&f_type=DOCUMENT&f_locale=en&f_locale=&f_locale=en&text=%22edi%22||target="blank"]]
Eva Torken 12.1 71 )))((({{toc/}}))){{/container}}{{/container}}