Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 6 Grouping Activities : Iterate Loop

Iterate Loop
An Iterate loop repeats the series of grouped activities once for every item in an existing sequence or list. The list can be items of any datatype. The following is an example of an iterate loop.
The process performs the following operations:
1.
2.
3.
4.
The following is the configuration for this example:
In this example, the repeating element $QueryCustomer/Customer/Record is used to determine the number of iterations to perform. One iteration is performed for every element contained in the repeating element.
See Chapter 9, XPath for more information on creating XPath expressions.
Iteration Element
The Iteration Element field on the Configuration tab allows you to supply a name for a process variable containing the current iteration element. This allows you to easily map the value of the current iteration element instead of using predicates on the process variable used for iteration. When you specify a value for this field, a process variable with the specified name appears in the Process Data tree in the Input tab. For example, in the Iterate group above, we specified curent-record as the name for the current element. This causes the following to appear in the process data tree:
Notice that both $QueryCustomer/Customer and $current-record contain the element Record. $current-record/Record is a copy of the $QueryCustomer/Customer/Record[i] element, the current element being processed. If you use $QueryCustomer/Customer/Record[i] in an input mapping, TIBCO ActiveMatrix BusinessWorks traverses the $QueryCustomer/Customer/Record element to retrieve the current element each time the loop iterates. By using the $current-record/Record element instead, you save processes time in proportion to how many times the iteration loop repeats. The larger number of elements contained in the $QueryCustomer/Customer/Record repeating element, the greater the performance improvement you will notice by using $current-record/Record instead of $QueryCustomer/Customer/Record[i].

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved