The EDI Message Parser object within Astera allows for the parsing of EDI message text from an EDI Source File object. This object is designed to interpret and convert the raw EDI message strings into a structured format that can be utilized within the Dataflow for further processing and mapping.
In this section, we will cover how to get an EDI Message Parser object onto the Dataflow designer.
To get an EDI Message Parser object from the Toolbox, go to Toolbox > EDI > EDI Message Parser object. If you are unable to see the Toolbox, go to View > Toolbox or press Ctrl + Alt + X.
Drag-and-drop the EDI Message Parser object onto the designer.
To use this object we will need a preconfigured EDI Source File object. The EDI Source File object provides us the unparsed EDI message in raw text format. The EDI Message Parser object then parses this text and creates nodes for each of the segments and elements. This provides us the ability to map the segments and elements further down the Dataflow.
Note: If the Parse Transactions option is checked in the EDI Source File object, then there is no need to use the EDI Message Parser as the EDI Source File object automatically parses the incoming EDI message.
To configure the EDI Message Parser object, right-click on its header and select Properties from the context menu.
As soon as we select the Properties option from the context menu, a dialog box will open.
This is where we can configure the properties for the EDI Message Parser object.
The first step is to provide the File Path for the EDI Partner Profile file (.Tpp).
Once this is configured, the EDI Message Parser object automatically uses the dialect and version information from the Partner Profile file in order to parse the source file.
The Version dropdown allows us to choose the version of the selected dialect that applies to our EDI file. The version dictates the structure and interpretation rules for the parsing of the EDI document. By default the version is picked based on the information from the EDI Partner Profile.
The Message option indicates the specific message type of the EDI file. This is typically a code that specifies the kind of transaction contained in the file. An example is the 834 Benefit Enrollment and Maintenance message within the 5010X220 version.
Next, we can enable the Show Error Collection option if we want the system to collect and display errors encountered while parsing the EDI file. It is a useful feature for debugging and ensuring the integrity of the data ingestion process.
HasErrors – True if the file contains errors, False otherwise.
Repository – Indicates which EDI repository is currently being used.
TransactionSetAcknowledgementCode – Shows the Transaction Set Acknowledgement Code of the EDI file
TransactionSetControlNumber –Shows Transaction Set Control Number of the EDI file.
TransactionSetIdentifierCode –Shows Transaction Set Identifier Code of the EDI file.
TransactionSetVersion –Shows the Transaction Set Version of the EDI file.
ActualCount – Shows the total amount of errors that have occurred.
ErrorDetail – Contains the details of the error that has been found in the EDI file.
LoopIdentifierCode –Shows the Loop Segment which contains the error.
PositionInFile – Shows the position where the error occurs within the Segment.
ErrorCode – Shows the Code number for the type of error contained in the EDI file.
In addition to this information, we are also shown error-specific information, which varies based on the type of error that has occurred. The error collection node is also visible in the Dataflow designer and may be mapped further for other usage.
Once we are done configuring the EDI Message Parser, we click Next and are directed to the Layout Modifications window.
Here, we click on the DTP Collection node and the Options for Collection panel appears.
Options for Collection:
Show – Shows collection node in the Tree Transform object.
Flatten With Item Count – Flattens data based on the record count in the collection node against each item in the parent node.
Flatten Based on Rules – Flattens a part of hierarchical data based on predefined rules.
Route Based on Rules – Routes and creates subsets of data based on predefined rules.
Merge With Item Count – Merges data based on the record count in the collection node against each item in the parent node.
Hide – Hides collection node from the Tree Transform object.
Calculation Formula – An expression box used for writing rules to route or flatten hierarchical data.
Sort Based On Keys – Sorts hierarchical data based on the field in the collection node. Only available for Show and Flatten With Item Count options.
If at any point throughout the layout modification process we want to see which nodes have been changed, we can check the Show Modified Nodes Only option. When this option is checked, the Layout Modifications window shows us only the nodes that were altered and hides the ones which were not.
In the Layout Modifications window we specify rules to flatten, route or merge our collection nodes for further use within the Dataflow, such as mapping them to other transformations and destinations.
To flatten our nodes, we choose the Flatten Based on Rules option. Once selected, a new section for adding rules will appear in the window.
To setup the rule, we configure the following options:
Description – This is the description provided to the rule for managing rules, organizing, naming, etc.
Active – If checked, the rule is active and therefore applied on the node. If unchecked, the rule is not applied on the node.
When the following condition holds – Enter the expression here based on which the node will be flattened.
In addition to working with the nodes, we can also apply calculations to the elements within the nodes.
Once we are done configuring the object, we will click Next. We are now taken to a new window, Config Parameters. Here, we can further configure and define parameters for the EDI Message Parser.
Parameters can provide easier deployment of flows by eliminating hardcoded values and provide an easier way of changing multiple configurations with a simple value change.
Click OK to conclude the configuration process for the EDI Message Parser object.
To use the EDI Message Parser object, we need to connect it to an EDI Source File object for file ingestion.
To preview data, right-click on the header of the EDI Message Parser object and select Preview Output from the context menu.
The Data Preview window will open. Upon expanding the EDI Message Parser, we will be able to see the parsed EDI file in hierarchical format.
We can now map this data to other transformations or destination files further down the Dataflow.
This concludes using the EDI Message Parser object in Astera.
If the EDI file contains an error, a red warning symbol is shown in the Data Preview window.
In the Data Preview, we can click the icon to expand the hierarchy and show the errors contained within this file. Here, we are provided information about the error and where it occurs. We commonly receive the following information for errors in the EDI file:
Here, there are two types of nodes. Single Instance nodes, represented with the icon and Collection nodes, represented with the icon. Clicking on these nodes will show us the Options for Collection, which allows us to modify the nodes and their structure.
Here we can add a new rule by clicking on the Add Switch Condition icon .