Contact Free trial Login

EDIFACT EDI Connector 2.1 - Mule 4

Support Category: Premium

Anypoint Connector for EDIFACT EDI (EDIFACT connector) enables you to convert EDIFACT messages to and from DataWeave-compatible representations using lists and maps.

The supported EDIFACT versions are provided.

Prerequisites

To use this connector, you must be familiar with:

  • Anypoint Connectors

  • Mule runtime engine (Mule)

  • Elements and global elements in a Mule flow

  • Creating a Mule app using Anypoint Studio (Studio)

To use the EDIFACT connector, you must have:

  • Purchased a MuleSoft license for Anypoint B2B

  • Anypoint Studio 7.0 or later

EDIFACT Connector supports files of up to 15 MB in size, and the memory requirement is approximately 40 to 1. For example, a 1-MB file requires up to 40 MB of memory to process, so it’s important to consider this memory requirement in conjunction with your Transactions Per Second (TPS) needs for large X12 files. This is not an exact figure; the value varies according to the complexity of the mapping instructions.

About the EDI Schema Language

The EDIFACT EDI Module uses a YAML format called ESL (for EDI Schema Language) to represent EDI schemas. Basic ESLs define the structure of EDI messages in terms of structures (messages, in EDIFACT terminology), groups, segments, composites, and elements.

You can customize the EDIFACT schema definitions to suit your data by defining an overlay schema. An overlay schema is a special form of ESL that allows you to modify a base schema, such as an EDIFACT D.98B ORDERS schema, with your specific conventions. You don’t need an overlay schema if you’re using the structure defined by the standard, but most EDI exchanges modify the base definitions in an implementation convention.

You can also define your own schemas, or copy and edit a base EDIFACT schema definition to suit your data.

See the EDI Schema Language Reference for more information.

About Schema Locations

To use the connector, you need to know the locations of the schemas in your project. If you’re using out-of-the-box EDIFACT schemas and not customizing anything, the schema location follows the /edifact/{version}/{message}.esl pattern, so for the D.98B version of the ORDERS message, your schema location is /edifact/d98b/ORDERS.esl.

If you’re using one or more custom schemas, put these under src/main/resources and refer to the location relative to this directory. For example, if you’ve put your ORDERS schema (either overlay or full) at src/main/resources/mypartner/ORDERS.esl, your schema location is /mypartner/ORDERS.esl.

About the EDIFACT Message Structure

The connector enables the reading or writing of EDIFACT documents into or from the canonical EDI message structure. This structure is represented as a hierarchy of Java Maps and Lists, that can be manipulated using DataWeave or code. Each transaction has its own structure as defined in the schemas.

The message contains the following keys (some only apply to either the Read operation or Write operations, as indicated):

Key Name Description

Delimiters (optional)

The delimiters for the message set use the last interchange processed by a read operation. Setting it for a write operation overrides the values in the module configuration. The characters in the string are interpreted based on position, in the following order: data element separator, component element separator, repetition separator, segment terminator, release character.

Errors (read only)

A list of errors associated with the entire input, or with interchanges that contain no valid messages

FunctionalAcksGenerated (read only)

A list of CONTRL acknowledgment messages generated by the module during the read operation

FunctionalAcksToSend (write only)

A list of CONTRL acknowledgment messages sent by the module during the write operation

Interchange (write only)

Map of UNB interchange header segment values used as defaults when writing interchanges

Messages

A hierarchy of messages that are read by the module during a read operation, or are sent by the module during a write operation. The value of this top-level key is a map with standard versions as keys, as in the form D96A. For example, if you are using version D96.A ORDERS and CUSRES messages, these Messages contain a map with one key, D96A. The value of this key is another map, one with two keys, ORDERS and CUSRES. Each of these contains a list of individual ORDERS and CUSRES messages available for processing.

Individual messages have their own maps, with the following keys:

Key Description

Detail

Map of segments or loops from the detail section of the message. These values are maps for segments or loops that occur once. Lists of maps are for values that repeat.

Errors (read only)

A list of errors associated with the message.

Heading

Map of segments or loops from the heading section of the message. These values are maps for segments or loops that occur once. Lists of maps are for values that repeat.

Id

Message ID, must match the key of the containing message list

Interchange

Map of UNB interchange header segment values. For message reading, this map is the actual data from the enclosing interchange. It is a single map linking all messages in the interchange. For message writing, these values are for creating the enclosing interchange. For example, gathering messages with the same interchange values into a single interchange, regardless of whether the actual maps are the same. If no values are populated in this map, then the default is the value from the Interchange map at the message level.

MessageHeader

Map of UNH message header segment values. For a write operation, provides the actual header data for a read operation and allows overrides for configuration settings.

Name

Message name.

Summary

Map of segments or loops from the summary section of the message. Values are maps for segments or loops that occur once. The lists of maps is used for repeating values.

Generated CONTRL functional acknowledgment messages differ from Received messages in their handling of interchange information.

Key name Description

Interchange

For functional acknowledgments generated by Receive processing, this map is a copy of the data for the containing interchange with Sender and Receiver identification components (UNB2.1/UNB2.2 and UNB2.1/UNB3.2). For writing a message, use these values are for creating the enclosing interchange. For example, gathering messages with the same interchange values into a single interchange, regardless of whether the actual maps are the same. Values not populated in this map default to the values from the Interchange map at the message level.

Next Step

After you complete the prerequisites, you are ready to create your own app and configure the connector using Anypoint Studio.