Iteration:
The details of each iteration of a loop block in a workflow Process Instance.
Each time a LoopBegin activity in a loop block (LoopBegin/LoopEnd activity pair) is executed, the details of the current iteration are stored in this table.
All Activity Instances and Transition Instances created within the context of a loop iteration will have a reference to the Iteration under which they were created.
Example
You define a workflow (Process Definition) to allow Users submit a Case for approval. The activities defined in your workflow are:
- 'Loop Begin' (An activity that indicates the start of a loop block) with loop condition 'While the case has not been approved, do the following'.
- Submit the Case for approval. (manual)
- Examine the Case and determine whether it should be approved (manual).
- 'Loop End' (An activity that signifies the end of a loop block).
- Notify the Case owner of the Case approval (automatic).
Ronan Rooney requires to submit a case for approval. A Process Instance of the desired workflow is enacted and an instance of the 'Loop Begin' activity is executed. An iteration record of the loop is written to this table with an iteration count of zero (the first iteration of the loop).
When Ronan Rooney submits the desired case for approval, an Activity Instance of the 'submit for approval' manual activity is created. As this activity is in a loop, the Activity Instance is associated with the iteration Id of the iteration record created.
John Smith examines the case in the second manual activity (which has its own Activity Instance associated with the iteration Id of the iteration record created) and does not approve it. The Approver adds comments to explain why the case was not approved.
The workflow engine determines that the loop should iterate again. It creates a new record in this table, incrementing the iteration count by 1 for the associated 'Loop Begin' Activity Instance.
Ronan Rooney examines the comments on the case approval, makes the necessary changes and submits the case for approval once more. This Activity Instance contains a reference to the second iteration record written to this table for the 'Loop Begin' Activity Instance.
John Smith examines the case again and decides to approve it.
The workflow engine determines that the loop should exit, and the case owner is notified of the case approval.
|