EDI X12 Order Processing Example

This example shows how to process an X12 850 document, export data to a CSV file, and generate a 997 acknowledgement using the File endpoint, X12 Module, Using MEL with Batch Processing module, and DataWeave


Before going further, install Anypoint Studio, the EDI Module in Anypoint Studio, and be familiar with the basic concepts of Mule applications.


The example application is comprised of two flows and a batch process.

These do the following:

  • ReceiveOrdersFromPartner: Reads in an EDI file, validates it, sends it off for processing, and triggers the sending of an acknowledgement.

  • Process850s: This batch job processes each record and outputs them to a CSV file with the item ID, quantity, and price.

  • SendAck: Send a 997 acknowledgement generated from the first flow.


Steps to Run the Example

To run this example:

  1. Download the application by clicking the EDI X12 850 Processing zip file.

  2. Import the application into Anypoint Studio by going to the File menu, clicking Import, and selecting Anypoint Studio Generated Deployable Archives. Then click Next, select the downloaded application, and click Finish.

  3. Right-click the Read EDI Doc message processor and click Add X12 EDI libraries to project.

  4. Right-click the imported project folder, "x12-850-processing", select Run As, and click Mule Application.

  5. Inside the project is a file in src/test/resources called "walmart.edi". Create a copy and place it in the input folder.

  6. After a few seconds, two files are created in the output directory. "ack.edi" contains the 997 acknowledgement and the "export.csv" file which contains the exported items from the 850.