Overview

Many business processes are required to repeat until some condition is met. In Cúram, this is implemented using the loop-begin and loop-end activities. All activities that are between a loop-begin and its associated loop-end activity are repeated until the loop completes.

In a process definition, loop begin and loop end activities come in pairs, and the metadata allows each loop-begin to know its associated loop-end and vice versa. To add a sequence of activities to a loop, a transition is created from the loop-begin activity to the first activity to be repeated. Subsequent activities in the sequence are linked using transitions as would normally be done outside a loop; however, the last activity in the sequence has a transition to the loop-end activity. A common impulse is to also add a transition from the loop-end activity to the start to create the cycle; however, this is incorrect and results in an invalid process definition.

A loop must also specify the criteria the loop will use to determine whether or not to terminate. To support this, a loop in Cúram workflow has a loop-exit condition.

Loops can contain other loops as long as they are fully nested and do not interleave each other. This ensures that the loops and therefore the process definition remains a valid block structure as required by the Cúram workflow engine (see Workflow Structure).