Custom Attributes- Anypoint Partner Manager

Pranav Davar
Another Integration Blog
4 min readFeb 2, 2023

Anypoint Partner Manager(APM), is a low code platform by MuleSoft to enable B2B EDI transactions. While tracking EDI transactions, it sometimes becomes cumbersome to search or query a particular transaction. Let us assume we are dealing with the purchase order transaction(EDI 850). We can query a transaction using basic parameters like transaction date, partner edi id, ICN number, etc. What if we need to query data with a PO number or any other custom field/attribute and make it searchable? Is it possible to do so?

Yes, it is possible. MuleSoft provides a way to create custom attributes and extract the values from inbound messages to the custom attributes. Below are the steps required to configure custom attributes and search the transaction using them.

Create a custom attribute

  • Login to Anypoint Partner Manager
  • Under the host tab, scroll down to the Custom Attributes area.
  • Click on New. Enter the Alias and Label. Select the “Is searchable” checkbox, if you want to make the attribute searchable in the activity flow.
  • Make sure to create a unique and meaningful Alias, as an alias cannot be changed once an attribute is created.
  • After filling in the details, click on save. The new attribute will be shown below.

Once we have created the custom attributes, the next step is to create a .dwl file to extract the data from the inbound messages.

Configure Message Types with custom attributes.

  • Under Message type, click on New. A pop-up window will open. It is similar to how we configure a new message type. In this example, we will be configuring EDI X12 850 v4010.
  • Click on choose file and upload a .dwl file under Reference identifiers and attributes mapping.
  • Below is the sample file created to extract the Purchase Order Number and map it to the alias “purchaseOrderNumber”.
%dw 2.0
output application/json
---
{
businessDocumentKey: payload.TransactionSets.v004010."850".Heading."020_BEG".BEG03[0],
customAttributes: [
{
alias: "purchaseOrderNumber",
values: payload.TransactionSets.v004010."850" map (v850, indexOf850) ->
v850.Heading."020_BEG".BEG03 default "UNKNOWN"
}
]
}

Once the message type is configured, we need to use the same message type in the message flow, and the rest will be taken care of by Anypoint Partner Manager.

Let’s see how can we view the custom attribute in the activity flow and search with the purchase order number.

Viewing and querying transactions with custom attributes

  • Once the EDI 850 is processed, the custom attribute will be shown below under the summary of the transaction.

In the above image, we can see the Purchase Order Number(Label) populated correctly.

  • To search for a transaction with a custom attribute(Purchase Order Number), click on the drop-down menu of Message Attributes and select the required custom attribute.
  • Input the value for the PO number and click on refresh.

The transaction will be queried and displayed on the screen. With this, it becomes easy and effective to query the transactions.

Thank you for reading and please share any thoughts or comments.

--

--

Pranav Davar
Another Integration Blog

Module Lead at TEKsystems Global Services in India | MuleSoft Certified Platform Architect | Mulesoft Mentor