Recently, Boomi has introduced a new feature in the map: Map Functions Ordering.
This feature is very useful as it allows us to control the sequence of which map functions to be executed to achieve the desirable result. Here is a simple scenario.
Imagine we have this set of data and we would like to calculate the total amount in the maps steps.
To achieve this, we will create two map functions:
1. calculateTotalAmt user defined function – this will calculate the running total and store the value into a user defined document property called “totalamount”
2. get user defined document property function – this will retrieve the value stored in step 1
Figure 1: Map step in Boomi
By looking at it, the process should return me 91.50 as the total amount. But the reality is the process will return me empty result instead. This is because Boomi will return me the value of “total amount” user defined document property first before it is being set in the calculateTotalAmt user defined function. To overcome this problem, we can enable the Map Functions Ordering by clicking on the “Order function executions” icon shown in Figure 2 and check on the “Enabled map function ordering?” checkbox.
Once it is enabled, we can move the calculateTotalAmt user defined function to the top and click Ok to save the ordering.
Now try to run the process again and it should return 91.50 as expected.