Merging Input from Multiple Sources

You may have multiple elements in the Process Data that you wish to map to one repeating element in the Activity Input. For example, you may have multiple formats for customer records and you wish to create a single, merged mailing list containing all customers in one format. In this example, the schemas are the following:

The following procedure describes how to map multiple elements into a single repeating element.

Procedure 

  1. Select the repeating element in the Activity Input area, right-click, and select Statement > Duplicate from the popup menu.

    Because you are creating two different formulas for mapping, you need two copies of the repeating element, one for each format. The resulting output contains only one repeating customer element, but the two copies in the Activity Input area make it simpler to perform two different mappings.

  2. Map one of the elements from the Process Data to the first copy of the repeating element in the activity input. For example, map $Retrieve-Customer-Type1/Customer to MergeMailingList/CustomerList/Customer.

    The Mapping Wizard dialog appears and presents choices for what you would like to accomplish. Choose the For Each option and click Next.

    The mapping wizard asks if you wish to automatically map items with the same names. Click Finish to accept the default mappings.

  3. Map the other element from the Process Data to the second copy of the repeating element in the activity input. For example, map $Retrieve-Customer-Type2/Record to MergeMailingList/CustomerList/Customer.

    In the Mapping Wizard dialog, choose the For Each option and click Next.

    The mapping wizard presents you with an option to automatically map elements with the same name. Click Finish to accept the default mappings.

  4. Select the Address element and click the XPath Formula Builder icon in the Input tab toolbar. In the XPath Formula Builder, drag a concat() function into the XPath Formula field. This function is used to concatenate the three elements in the Record element in the process data area to one Address element in the activity’s input.

    Click the Data tab, then drag the $current()/Address/street element into the << string1 >> placeholder in the concat() function.

    Drag the $current()/Address/state element into the << string2 >> placeholder in the concat() function. Then, add a comma to the end of the function to include a third string to concatenate. Drag the $current()/Address/zip element into the position of the third string in the concat() function.

  5. Click Apply, then click Close to dismiss the XPath Formula Builder dialog.

  6. This results in the following mapping: