![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
1. Select the repeating element in the Function panel, right-click, and select Statement > Duplicate from the menu.
2. Map one of the elements from the Scope Variables to the first copy of the repeating element in the Function. For example, map $Retrieve-Customer-Type1/Customer to MergeMailingList/CustomerList/Customer.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 Scope Variables to the second copy of the repeating element in the Function. For example, map $Retrieve-Customer-Type2/Record to MergeMailingList/CustomerList/Customer.
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 Scope Variables area to one Address element in the function’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.
1. Choose the repeating element in the function input schema that holds the grouped data. In this example, that element is Orders. Right-click on this element and choose Statement > Surround with For-Each-Group... from the pop-up menu. This is a shortcut to create a For-Each-Group statement with the Orders element as a child element and a Grouping statement to contain the element you wish to group-by.Adding the Grouping statement creates the $=current-group() element in the Scope Variables area. The Grouping statement creates the list grouped by the desired element, and the current-group() function allows you to access the items in the Requests repeating element that correspond to the group that is currently being processed.
4. Map the current-group() element in the Scope Variables area to the repeating element Order under the Customer element in the Function panel.This creates an item in the Order list for each item in the current customer ID group that is being processed. The mapping wizard asks if you wish to map items with the same name in the current group and the orders group.
5. Map the remaining element from the current-group() element into the desired element in the For-Each group. In this case, quantity would map to Quantity automatically, and Item must be mapped to ItemName.
6.
1. Map the first repeating element from the Scope Variables area into the Grades repeating element in the Function panel. In this example, the $RetrieveStudentIDs/Students/Record is the first repeating element.This brings up the mapping wizard with the default choice of creating a For-Each statement. Click Finish in the Mapping Wizard dialog to create the For-Each statement.The $=[index=] element contains the XPath formula position() to set the element with the current position number of the list item being processed. The $=[item=] element contains a statement to retrieve the item in the second repeating element that corresponds to the position of the item in the first list that is currently being processed.
5.
6. The following procedure describes how to coerce the Body element of the incoming message into a specific datatype and map it to a choice element.
3. Map the Name element to the Name element in the Function panel. Then, map the coerced Order element to the choice element in the Function panel.The Mapping Wizard dialog appears and asks if you wish to create an Order or a CreditLimitIncrease element. Select Order and click Next.The Mapping Wizard then asks you to create a For Each. Even though there is only one element in the Scope Variables schema (the Message element is not repeating), a For Each is used because this construct allows you to map the individual items of the Order element. Click Next to continue.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |