Activity Instance:
The runtime data for an activity in an enacted workflow.
A new Activity Instance row is created for each execution of an activity in the enactment of a workflow Process Definition.
Example
You define a workflow (Process Definition) to allow correspondence to be sent to customers whenever their payment details change. The activities defined in your workflow are:
- system prints out a letter (automatic);
- User puts the letter in an envelope and posts it (manual); and
- 'End Process' (a necessary step to end the workflow which is mandated by the Process Definition Tool).
Person John Smith's payment details change due to an increase in rates. This increase raises an event which causes the Workflow Engine to enact your workflow and create a Process Instance.
The Process Definition specifies an initial activity ('system prints out a letter') and so the Workflow Engine creates an Activity Instance row for this initial activity and sets its startDateTime. Because this activity is an automatic one, the Workflow Engine immediately calls the business processing defined by the activity. Upon completion of the business processing, the Workflow Engine sets the endDateTime on the Activity Instance and marks it as completed.
The Workflow Engine follows the transition out of the 'system prints a letter' activity and determines that the next activity is 'User puts the letter in an envelope'. The Workflow Engine creates another Activity Instance row for this next step in the workflow and sets its startDateTime. Because this activity is a manual one, the Workflow Engine creates a Task for a User to perform the work. User Ronan Rooney performs the work and upon completion he opens the correspondence screen and marks the letter as 'sent'. Curam raises an event which causes the Workflow Engine to:
- close the Task;
- set the endDateTime on the Activity Instance and mark it as completed; and
- follows the transition out of the 'User puts the letter in an envelope' activity.
The Workflow Engine determines that the next activity is 'End Process', which performs the necessary clean up and ends the Process Instance.
Technical Notes There is no 'Activity' database table. An activity is an XML element defined within the Process Definition metadata.
For 'sequential' workflows there will only be at most one active Activity Instance for any Process Instance. However, a Process Definition can specify concurrent paths and thus for such 'concurrent' workflows a Process Instance may have multiple active Activity Instances.
For a workflow which contains no loops, there will be at most one Activity Instance for each activity defined in the Process Definition. However, if the Process Definition makes use of loops, then there can be multiple Activity Instances for the same activity (one for each iteration round the loop); note though that at most one of these 'loop' Activity Instances will be active.
The Process Definition Tool (PDT) ensures that every Process Definition has an 'End Process' activity.
|