Contact Free trial Login

X12 EDI Connector 2.5 - Mule 4

Support Category: Premium

Anypoint Connector for X12 EDI (X12 Connector) enables you to convert X12 messages to and from DataWeave-compatible representations using lists and maps. The schema definitions for all supported X12 standard transaction sets are provided. For complete information on schemas, see X12 EDI Schema Language Reference.

Many HIPAA document versions are also supported, as listed separately in the Supported HIPAA Versions. For more information on HIPAA usage, refer to Connector HIPAA Standards

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 X12 EDI connector, you must have:

  • Purchased a MuleSoft license for Anypoint B2B

  • Anypoint Studio 7.0 or later

X12 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

X12 Connector uses a YAML format called EDI Schema Language (ESL) to represent EDI schemas. Basic ESLs define the structure of EDI messages in terms of:

  • structures - known as transaction sets in X12 terminology

  • groups - known as loops, in X12

  • segments, composites, and elements

ESLs for the all supported X12 versions are included. If you are using HIPAA, then a set of HIPAA variations of base X12 transaction sets are included.

You can customize X12 schema definitions to suit your data by defining an overlay schema. An overlay schema is a type of ESL that allows you to modify a base schema, such as an X12 4010 850 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 define your own schemas from scratch, or copy and edit a base X12 schema definition to suit your data as shown in the EDI Schema Language Reference.

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 X12 schemas and not customizing anything, the schema location follows the /x12/{version}/{transaction set}.esl convention.

For example, using the 005010 version and the 850 transaction set, the schema location is /x12/005010/850.esl.

If you’re using one or more custom schemas, refer to XML Schema and Trading Partner Configuration for complete information on setting your schema locations.

About X12 Connector Message Structure

This connector enables the reading or writing of X12 documents into (or from) the canonical EDI message structure. This structure is a hierarchy of Java Maps and Lists. You use either DataWeave or code to manipulate them. Each transaction has its structure as defined in the schemas.

The message itself contains the following keys, some of which only apply to either the read operation or the write operation, as indicated:

Key name Description

Delimiters

The delimiters used for the message. If used, this set is based on the last interchange processed by a read operation. If set for a write operation, this overrides the values in the module configuration. The characters in the string are interpreted based on position in the following order: data separator, sub-element separator, repetition separator, or U if none, segment terminator.

Errors (read only)

A list of errors that are associated with the input as a whole, or with interchanges with no valid transaction sets

FunctionalAcksGenerated (read only)

A list of 997 or 999 configured acknowledgments that are generated by the module during the read operation

Group (write only)

Map of GS group header segment values used as defaults when writing groups

Interchange (write only)

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

InterchangeAcksGenerated (read only)

A list of TA1 acknowledgments that were generated by the module during the read operation

InterchangeAcksReceived (read only)

A list of TA1 acknowledgments that were received by the module during the read operation

InterchangeAcksToSend (write only)

A list of TA1 acknowledgments that are sent by the module during the write operation

Transactions

A hierarchy of the transaction sets 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, in the form of v005010. For example, if you are using version 005010 850 and 855 transaction sets, the Transactions would contain a map with one key, v005010. The value of this key would be another map, one with two keys, 850 and 855. Each of these contain a list of individual 850 and 855 transaction sets that are processed. If you’re using 997 functional acknowledgments. Then 997 is the key for a list of 997 transaction sets.

Individual transaction sets have their own maps, with the following keys:

Key Description

Detail

Map of segments or loops from the detail section of the transaction set. Values are maps for segments or loops that occur once, lists of maps for values that are repeated.

Errors (read only)

A list of errors that are associated with the transaction set

Group

Map of GS group header segment values. When reading a message, this map is the actual data from the enclosing group, that is, a single map linked from all transaction sets in the group. When writing a message, these values are used for creating the enclosing group. Values not populated in this map then default to the values from the Group map at the message level.

Heading

Map of segments or loops from the heading section of the transaction set. Values are maps for segments or loops that occur once. Lists of maps are for values that are repeated.

Id

Transaction ID, which must match the key of the containing transaction list.

Interchange

Map of ISA interchange header segment values. When reading a message, this map is the actual data from the enclosing interchange. This is a single map linked from all transaction sets in the interchange. When writing a message, these values are used for creating the enclosing interchange. For example, gathering transactions 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.

Name

Transaction set name

SetHeader

Map of ST transaction set header segment values. This gives the actual header data for a read operation, and allows you to provide overrides for for write operation configuration settings.

Summary

Map of segments or loops from the summary section of the transaction set. Values are maps for segments or loops that occur once, lists of maps are for values that are repeated.

Generated 997 or 999 functional acknowledgment transactions differ from received messages in their handling of interchange information:

Key name Description

Interchange

Map of ISA interchange header segment values. 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 (ISA05/ISA06 and ISA07/ISA08) interchanged. When writing a message, these values are used for creating the enclosing interchange. For example, gathering transactions 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.

TA1 interchange acknowledgments are in the form of maps representing the TA1 segment data and linked to data on the corresponding interchange:

Key name Description

Interchange

Map of ISA interchange header segment values. For TA1 acknowledgments generated by receive processing, this map is a copy of the data for the interchange matching the TA1 with sender and receiver identification components (ISA05/ISA06 and ISA07/ISA08) interchanged. When writing a message, these values are used for creating the enclosing interchange. That is, gathering transactions 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.

Exchange Templates and Examples

Anypoint Exchange provides templates that you can use as starting points for your apps and examples that illustrate a complete solution.

X12 Connector Templates in Exchange

Sets up your Outbound transactions.

Use this for setting up your inbound transactions.

Use this for setting up your Partner Manager content storage.

X12 Connector Examples in Exchange

This example shows how to transform an X12 EDI purchase order from XML to JSON.

This example shows how to transform an Outbound purchase order.

This example shows how to transform an Inbound purchase order.

Next Step

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