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 a x12 connector for 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.
Here is how the application will look like:
Below mentioned steps are to be followed for the transformation.
- Import the x12 module to your project from Exchange.
- Put a File – On 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.
- A logger can be put to check the payload received.
- 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 which needs to be used.
- For the EDI file to be formatted and segments to be separated by new line and add this in configuration.
- Drag the transform message to map the fields and for the transformation. As soon as the transform message is added, the elements according to the mentioned EDI file are populated for the mapping.
- Map the fields as required.
- Log the output.