Transaction Tracking Walkthrough
This document is aimed at a technical audience possessing basic knowledge of Anypoint Studio and Anypoint B2B.
Anypoint Studio with Mule Server 3.7.1 EE runtime
Anypoint Platform account
Amazon S3 bucket for file storage (optional)
Download the application and import it into Anypoint Studio.
From your web browser, log into Anypoint Partner Manager. Go to the Home Organization page and copy your secret API key.
From the imported Mule project in Anypoint Studio, click the file
appfolder, and select the Global Elements view tab. Open the Partner Manager Connector configuration and set the API Key you generated from Anypoint Partner Manager.
Right-click the imported project folder from the Project Explorer view. Select Run As and click Mule Application.
Create a copy of the file
src/test/resourcesand place it in the
The file should disappear from the directory since the File Connector message source deletes the file after it reads it.
Access the B2B Transmissions page in the Anypoint Partner Manager to confirm that the B2B exchange was tracked.
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.
Launch Anypoint Studio and create a new Mule project.
Switch to the Global Elements view and create a Partner Manager Connector configuration as described in the AS2 and X12 Purchase Order Walkthrough.
Go back to the Message Flow view. Drag the File Connector from the palette to the canvas in order to create a message source:
Configure the File Connector message source to read from a directory called
Add an Object to String transformer after the message source in order to read from the file stream:
Drag the Partner Manager Connector from the palette and add it to the flow:
Select as Connector Configuration the config that you created in step 2. Select Track transmission for the operation:
Configure the Track transmission operation as follows:
Content Reference (Set only if you have configured the File Storage type on the Partner Manager Connector config)
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:
Add a File Connector to the flow such that the purchase order is written out to a different directory called
Right-click on the project and run the application as a Mule project:
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.
Drop the file b2b-tracking-po.xml in the
outboxdirectory. You should see the file moved to the
Access the Anypoint Partner Manager and go to the B2B transmissions view to confirm that the exchange was tracked: