Note: The workflow sample mentioned in this article can be downloaded from the Opalis project on CodePlex: http://opalis.codeplex.com
This is a collection of Workflows that demonstrates how to use looping for Workflow Activities and Child Workflows.
This example demonstrates two types of loops:
This Workflow iterates five times over the Send Platform Event Activity ‘Loop Counting (5 Loops)’. The Send Platform Event Activity is configured to display a summary message:
The looping properties (right mouse click, Looping…) are configured for a five second delay between each loop:
The loop will exit when five loops have been performed:
Next, the Workflow iterates over the Send Platform Event Activity ‘Loop Timing (25 seconds)’ for twenty-five seconds. The Send Platform Event Activity is configured to display a summary message:
The loop will exit when more than twenty-five seconds have passed since the loop started:
Launch the Workflow by using Start, or by running it using the Workflow Testing Console. Check the Opalis Designer Events tab or the Testing Console log to see the resulting output:
This example demonstrates looping a child Workflow. The Trigger Policy Activity ‘Trigger Workflow: 2. Child Workflow’ is used to start the Workflow named ‘2. Child Workflow’. By looping the Trigger Policy Activity, the child Workflow will be triggered for every loop cycle:
The loop will exit when three loops have been performed:
The Send Platform Activity displays a message to indicate that the loop and therefore the parent Workflow has completed:
This Workflow will be triggered by the parent Workflow named ‘2.1 Loop a Child Workflow’. The Send Platform Event Activity displays a summary message:
Launch the Workflow ‘2.1 Loop a Child Workflow’ by using Start, or by running it using the Operator Console. Check the Opalis Designer Events tab or the Operator Console Event screen to see the resulting output:
Search the Opalis Online Help for 'Looping Properties' to get more information on Looping.