Converting A cXML To EDI Of Desired Version

Author: Ankita Jha

cXML (or Commerce XML) is an XML-based standard that allows transactions to be sent and received between a buyer and a seller’s system. Mule provides an x12 connector for the conversion of cXML to EDI. Here we will be converting a cXML file to EDI version x12/4010/856. 856 is the Advance Ship Notice EDI.

This is how the application will look like:

Below mentioned steps are to be followed for the transformation:

  1. Import the x12 module to your project from Exchange.
  1. Put a File – On a New or Updated connector and point it to the folder where your cXML file resides. Instead of this a listener can also be put and the cXML can be sent as the body.
  2. A logger can be put in to check the payload received.
  1. Put the x12 write connector after the logger. The x12 will need to be added and configured. The desired EDI version can be put here as the schema definition. Here we can put standard/custom EDI schemas that need to be used. The schemas will get included as a part of Mule folder as soon as we import x12 to our project 
  1. For the EDI file to be formatted and segments to be separated by a new line, add this to the configuration.
  1. Drag the transforming message to map the fields and for the transformation. As soon as the transforming message is added, the elements according to the mentioned EDI file are populated for the mapping.
  1. Map the fields as required. 
  1. Log the output.

Sample Input and Output:

Input – 

Output – 

We use cookies on this site to enhance your user experience. For a complete overview of how we use cookies, please see our privacy policy.