This example illustrates how to transform EDI X12 850 purchase order transactions received from trading partners into inbound enterprise purchase order JSON message structure to be integrated with backend systems for order capture.
This example reads EDI purchase orders from an Anypoint MQ, and leverages X12 Read operation of the Anypoint X12 connector to transform the EDI X12 850 transactions into Enterprise inbound purchase order JSON structure. The translated JSON messages are published to an Anypoint MQ queue via a downstream process API, to be sent to the backend ERP / order management system.
Setup the Example
- Open the Example project in Anypoint Studio from Anypoint Exchange.
- Install the latest version of Anypoint X12 connector
- Update the configuration property file located in src/main/resources/app.properties with the below values.
- Anypoint MQ configurations
- Create a new Anypoint MQ queues as2-inbound-edi.q and ent-inbound-po.q from Anypoint MQ console
- Create a new client app
- Update the below properties in app.properties file with the API URL, Client Id and Client Secret for the Anypoint MQ connection.
- The project includes the dataweave map to transform EDI X12 4010 850 transactions into Enterprise inbound JSON purchase order messages.
- Deploy the project to CloudHub or run locally
- Update the properties po-proc-api.host and po-proc-api.port, as well as TLS configurations for the HTTP request component as appropriate when deploying to CloudHub.
Run the Example
- Drop the raw EDI payload from src/main/resources/EDI-4010-850-NTO-to-Mythical.edi into the Anypoint MQ queue as2-inbound-edi.q
- The EDI message is consumed by the application, and the translated JSON message is published to the queue ent-inbound-po.q via the Process API, running on the same app with Mule configuration file mythical-inbound-po-process-api.xml.
- Note: The process API included in the example simply publishes the JSON message to Anypoint MQ, illustrating how inbound B2B transactions can be handed off to downstream process APIs orchestrating end to end purchase order workflow.