Contact Us 1-800-596-4880

Translation Maps

Anypoint Partner Manager uses DataWeave translation maps to transform business transactions between your partner’s message formats (CSV, EDIFACT, X12, JSON, or XML) and your organization’s enterprise application message formats (CSV, JSON, or XML).

To use a translation map, create the map in Anypoint Studio and then import the map to Partner Manager when you configure an inbound or outbound message flow.

To start with an example of a translation map, download and then customize the B2B/EDI: Order to Cash - Mapping Examples from Exchange. This example includes the following transformations for message flows:

  • Inbound message flows:

    • X12 4010 850 to JSON

    • EDIFACT D97A to JSON

    • CSV to JSON

    • XML to JSON

  • Outbound message flows:

    • JSON to X12 4010 855

    • JSON to EDIFACT D97A

    • JSON to CSV

    • JSON to XML

To customize this example:

  1. Open the .jar file in Studio.

  2. Change the source message type.

  3. Change the target message type.

  4. Map the input to the output.

  5. Test the map locally.

  6. Import the map to a Partner Manager message flow.

Open the .jar File in Studio

To open the .jar file:

  1. Launch Studio.

  2. From the File menu, select Import > Packaged mule application (.jar) and click Next.

  3. Select the downloaded .jar file and click Open.

  4. Click Finish.

Change the Source Message Type

To change the message type:

  1. Click the Global Elements tab at the base of the Studio canvas.

  2. From Global Configuration Elements, select the configuration for the map to use in an inbound or outbound message flow.

  3. Click Edit.

  4. In Name, change the name of the configuration to something meaningful.

  5. If the message flow uses the EDI, JSON, X12, or XML format:

    1. In Schema definitions, select Edit inline.

    2. In Value, enter the version and transaction set to map to or from.

      For example, set Value to /x12/005010/830.esl to map to or from a 005010-830 transaction.

  6. Click OK.

Change the Target Message Type

To change the target message type:

  1. If your target message type has an associated schema, copy the schema file into the <Project-name>/src/main/resources folder in the project.

  2. Select the Transform Message component.

    The new transaction set structure displays in one pane of the Transform Message graphical view, and your application message structure (CSV, JSON, or XML) displays in the other pane of this view.

  3. Map the input fields to the output fields.

Test the Map Locally

To test the map locally:

  1. In Package Explorer, right-click on the template project, and select Run > Run as Mule application.

  2. Use a REST client to post a message payload.

    For example Postman calls, see the B2B-Order-to-Cash-Mapping-Studio.postman_collection.json file in the examples folder.

    The application returns the transformed payload.

  3. After you verify that the map works correctly, copy the DataWeave map from src/main/resources and rename it to something meaningful.

Import the Map to a Partner Manager Message Flow

When you configure a message flow, you can import the .dwl file to the Map section of the message flow.