Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 5 Scopes, Iteration, and Conditional Processing Using Groups : Overview of Loops

Overview of Loops
Loops allow you to execute a series of activities more than once. You can iterate based on the items in an array stored in a process variable or you can iterate while a given condition is true. The following are the types of loops that are available:
Loops allow you to accumulate the output of a single activity in the loop for each execution of the loop. This allows you to retrieve output from each execution of the activity in the loop. See Accumulate Output for more information about accumulating the output of each iteration of a loop.
Index Variable
The index variable holds the current number of times a loop has executed. The iteration count starts at one the first time the loop is executed, and the count increases by one for each iteration of the loop. You can access this variable like any other process variable by referencing it with a dollar sign ($) in front of it.
Accumulate Output
You can accumulate the output of one of the activities in a group by checking the Accumulate Output field. If you check this field, you can select one of the activities in the group, and each time the loop is executed, the selected activity’s output is placed into a list. The list of accumulated output for that activity is stored in a variable whose name is specified in the Output Name field. After the loop exits, this variable can be accessed in the same way other process data can be accessed by other activities.
Because you can accumulate output from only one activity in a group, you should design your group so that only one activity in the group holds the data to accumulate for each iteration. For example, you may wish to accumulate the sum of the amount for line items in an order.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved