This section describes the EDI Editor tool which is used to design EDI schemas using .efl files. EFL files are used by the XML2EDI and EDI2XML prebuilt microservices to facilitate data conversion of EDI data from and to its corresponding XML format respectively.
In case you require your composite component flow to read or write data from your data repository which exists as EDI/XML, The XML2EDI component is used for transforming information from XML format to EDI format and EDI2XML component is used for transforming information from EDI format to XML format.
Before transforming data from EFL file format into its corresponding XML or vice versa, the EDI Schema needs to be defined to aid the transformation. This EDI Schema may be understood as the format meta-data that is required in both the above-mentioned instances.
The EDI Editor is a tool which assists in visually defining the format and hierarchy of the EFL data graphically. The format structure created by this editor is called the EDI schema in which the structure of the non-XML data is defined in terms of Segment Groups and Segment Nodes as well as Data Group and Data Element. This format is stored using XML grammar in EFL files.
Once this schema format is defined, it can be used by:
- EDI2XML transforms EFL data to its corresponding XML.
- XML2EDI transforms XML data into its corresponding EFL format
The non-XML data mentioned above can be delimited, positional or both. EDI Editor also provides the test functionality in which the user can verify and test the schema formats created. In the test functionality, the user can generate sample data and can also transform sample EDI data to XML and vice versa.
EDI File Format Layout Concepts
An EFL document is a specialized XML grammar which is used to describe the structure of non-XML structured (delimited, positional) data. In the EFL document, the structure of the data is defined as a hierarchical tree of segments and data in a given order.
Figure 1: Structure of an EFL document
The schema of the structured data is added as a child node to this Root Node. This node is called the Schema Node. When you create a new schema in Fiorano Schema Editor, the Root Node and the Schema Node are created automatically.
- Schema Node: In the schema structure, each opened schema file is shown as Schema Node and is the child of the Root Node. The Schema Node corresponds to the Root tag of the output XML which is generated from the structured non-XML text or input XML which is to be converted to the structured non-XML text.
Schema Node can also be renamed. The properties of the Schema Node represent the default properties which can be used during data transformation. In a Schema Node, multiple record nodes can be added which represent the structure of input/output data. Adding data to the Schema Node is not allowed. - Segment: Record represents a collection of information. It can contain a set of data groups and/or elements.
- Data: Field represents items of information that are simple in nature, such as strings and numbers.
Creating EDI Projects
EDI projects can be created using EDI Editor view in the Fiorano Tools perspective. In the eStudio menu bar, navigate to Windows > Open Perspective > Other and select Fiorano Tools and click OK. This takes to Fiorano Tools perspective where the EDI Editor panel will be present next to the Flat File Schemas panel.
To define schema for this data, first create a new EDI File Schema Project.
- Right-click on Flat File Schemas Node and select New File Schema Project option.
Figure 2: Creating a new EDI File Schema project
- In the Create Project dialog box, provide a name for the project and click OK. A new project will be created with project name as root node.
The root node will have a tree structure as below with their corresponding properties in the Properties window:
- EDI Project
- Seg
- data
- Seg
Figure 3: EDI File Schema project structure
Editing an EDI Project
Renaming nodes
Segments and Data nodes can be renamed by any of the following ways:
- Right-click the node which has to be renamed.
Change the name property value in the Properties pane.
Figure 4: Renaming a node
Deleting a node
Select the Delete option in the context menu of the node that needs to be deleted to delete the node. See the figure above to find the Delete option in the context menu.
Editing properties
Values of the properties in a segment or data node can be changed in the Properties pane.
Figure 5: Properties pane for a node
Identifying an Error on the node
Whenever there's an error in the generated schema, an error badge appears on the respective node indicating the error. Hover the cursor over the node to see the error message.
Figure 6: Error symbol/tip on the node having an error
Changing the order of sub nodes
The order of nodes under a project can be changed. To change the order, right-click the project node and select Change Order option. The Up and Down arrow helps to change the order of the node selected.
Figure 7: Option to change the sort order
Exporting and Importing an EDI Project
An EDI file schema project can be exported using the Export option available on the context menu of the root node.
Figure 8: Exporting a project
An exported project can be imported by selecting Import Project option available on EDI File Schemas context menu.
Figure 9: Importing an already exported project
Testing an EDI File Schema
EDI file schema generated can be tested in the Test pane.
- Click the Test tab in the schema editor to open the Test pane.
Figure 10: Option to test the project
Sample XML data can be generated by clicking the Generate Sample XML Format button or the sample can be keyed/pasted in the XML Format pane and this may be edited as required.
Figure 11: Generating sample data in the XML format
Click the Convert XML format to XML format button. The content in the XML format gets converted to EDI and is displayed in the EDI Format section.
Figure 12: Output in the EDI format