Repeat Until True Loop
The Repeat Until True loop repeats the series of grouped activities until the given condition evaluates to true. The activities are always executed once before checking if the condition is true. After executing the series of activities, the condition is checked, and the loop exits when the condition evaluates as true. The following is an example of a Repeat Until True loop.
The process performs the following operations:
Procedure
-
A group of activities executes until the customer records have all been queried. The group consists of:
-
A Java Code activity that outputs all the valid customer IDs. When all valid IDs have been output, the activity will output -1 to indicate no more records can be queried.
-
A JDBC Query activity that takes each ID and queries a database for the record matching the ID.
-
A Send Mail activity that uses the customer information retrieved from the database to send an email to the customer notifying the customer of new product offerings.
For each iteration of the loop, the output of the QueryCustomer activity is placed into a variable named
customerList
. -
When the condition of the loop evaluates to true, the loop stops executing and transitions to the WriteCustomerList activity so that the customer list will be stored in a file.
The condition evaluates the value of
CustomerID/ID_num
. The Customer ID activity outputs -1 when there are no more customers, so the condition examines the value and when it is -1, the loop can exit.
The following is the configuration for this example Repeat Until True loop: