Transaction Tracking Walkthrough
|Current Anypoint Partner Manager solutions will continue to be supported in accordance with the Product Support and Maintenance Terms but will not be available for new customers or upgrades. Contact your MuleSoft representative for more information on MuleSoft’s B2B solutions.|
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)
Import this example into Anypoint Studio:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<?xml version="1.0"?> <PurchaseOrder PurchaseOrderNumber="00003" OrderDate="2015-05-13"> <TotalPrice>188.93</TotalPrice> <Address> <Name>Stocked.com</Name> <Street>123 Maple Street</Street> <City>Mill Valley</City> <State>CA</State> <Zip>10999</Zip> <Country>USA</Country> </Address> <Items> <Item PartNumber="3421-MB"> <ProductName>Ladies Jacket MED BLACK</ProductName> <Quantity>1</Quantity> <USPrice>148.95</USPrice> <ShipDate>2015-05-20</ShipDate> </Item> <Item PartNumber="4421-MB"> <ProductName>Ladies Base layer MED BLACK</ProductName> <Quantity>1</Quantity> <USPrice>39.98</USPrice> <ShipDate>2015-05-20</ShipDate> </Item> </Items> </PurchaseOrder>
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.
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 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.
+ . Put the example XML listed in Running the Example in the
outbox directory. 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: