Nav

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 Anypoint DataMapper User Guide and Reference

Prerequisites

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

Concepts

The example application is comprised of 2 flows and 1 batch process. These do the following:

  • ReceiveOrdersFromPartner: reads in an EDI file, validates it, send it off for processing and triggers sending of the 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 acknowelgement generated from the first flow.

B2B_EDIOrderProcessing

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.