Nav

Transaction Tracking Walkthrough

Audience

This document is aimed at a technical audience possessing basic knowledge of Anypoint Studio and Anypoint B2B.

Prerequisites

  • Anypoint Studio with Mule Server 3.7.1 EE runtime

  • Anypoint Platform account

  • Amazon S3 bucket for file storage (optional)

Running the example

  1. Download the application and import it into Anypoint Studio.

  2. From your web browser, log into Anypoint Partner Manager. Go to the Home Organization page and copy your secret API key.

  3. From the imported Mule project in Anypoint Studio, click the file b2b-tracking-transmission.xml in the app folder, and select the Global Elements view tab. Open the Partner Manager Connector configuration and set the API Key you generated from Anypoint Partner Manager.

  4. Right-click the imported project folder from the Project Explorer view. Select Run As and click Mule Application.

  5. Create a copy of the file po.xml in src/test/resources and place it in the outbox directory

  6. The file should disappear from the directory since the File Connector message source deletes the file after it reads it.

  7. Access the B2B Transmissions page in the Anypoint Partner Manager to confirm that the B2B exchange was tracked.

Anypoint B2B Platform Transaction Tracking Walkthrough

This walkthrough shows you how to leverage the Anypoint B2B Platform to track B2B exchanges for non-EDI messages and connectors that are not included in Anypoint B2B. In this walkthrough you will develop a Mule application that simulates a B2B exchange of a XML purchase order. The application will read a purchase order file from a directory in your local filesystem and save it to another directory. In between, the exchange, in terms of metadata, message content and other data, will be tracked using the Partner Manager Connector. Once tracked, the exchange can be viewed from the Anypoint Partner Manager.

  1. Launch Anypoint Studio and create a new Mule project.

  2. Switch to the Global Elements view and create a Partner Manager Connector configuration as described in the AS2 and X12 Purchase Order Walkthrough.

  3. Go back to the Message Flow view. Drag the File Connector from the palette to the canvas in order to create a message source:

    transmission-tracking-walk-1

  4. Configure the File Connector message source to read from a directory called outbox:

    transmission-tracking-walk-2

  5. Add an Object to String transformer after the message source in order to read from the file stream:

    transmission-tracking-walk-3

  6. Drag the Partner Manager Connector from the palette and add it to the flow:

    transmission-tracking-walk-4

  7. Select as Connector Configuration the config that you created in step 2. Select Track transmission for the operation:

    transmission-tracking-walk-5

  8. Configure the Track transmission operation as follows:

    Field

    Value

    From-party identifier

    #[xpath3(''/PurchaseOrder/Address/Name'')]

    To-party identifier

    My Organisation

    Content Reference (Set only if you have configured the File Storage type on the Partner Manager Connector config)

    #[payload]

    Filename

    #[flowVars.originalFilename]

    Format Type

    XML

    transmission-tracking-walk-6

    In addition to the above, click on Create Object manually which is located next to the Metadata attribute. This action brings up the Object Builder that allows you to define the metadata to be saved as part of the transmission. Define the metadata entries as shown in the screenshot below:

    transmission-tracking-walk-7

  9. Add a File Connector to the flow such that the purchase order is written out to a different directory called inbox:

    transmission-tracking-walk-8

  10. Right-click on the project and run the application as a Mule project:

    transmission-tracking-walk-9

    If you have enabled S3 storage in the Partner Manager Connector config, then you need to add the AWS and S3 parameters to the Mule application VM arguments. Consult the AS2 and X12 Purchase Order Walkthrough for information on how to add the parameters.

  11. Drop the file b2b-tracking-po.xml in the outbox directory. You should see the file moved to the inbox directory.

  12. Access the Anypoint Partner Manager and go to the B2B transmissions view to confirm that the exchange was tracked:

    transmission-tracking-walk-10