Adding Additional Instances to a Multi-instance Loop While the Task is Still in Progress

This implements control-flow pattern WCP-15—see the table "Supported Control Flow Patterns" in the "Workflow Patterns Reference" appendix of the TIBCO ActiveMatrix BPM - BPM Concepts guide.

Note: If you have a multi-instance user task and a loop which allows you to generate multiple copies of that task, if you have concurrent copies of the multi-instance user task, each with multiple instances, and then "add additional activity instances", the additional instances are added to every copy of the multi-instance user task.

To do this, you need to execute a script somewhere on a parallel path whilst the loop task is active. The script can add instances to the loop task using an expression similar to the following:

Process.addActivityLoopAdditionalInstances ("OrderStock",1);

which contains a string for the name of the task (in this example, OrderStock), and an integer for the number of additional instances required (in this example, 1)..

Note: If you wish to add additional instances to a dynamic sub-process task, you need to pre-populate the array that is chosen as the runtime identifier field with the name or names of the sub-process implementation that you wish to add, as well as any associated arrays used to provide input into the dynamic sub-process. See Creating Dynamic Sub-Processes .

You can also add additional instances to a loop in the loop task itself, but only in the task Complete script.

In this example, the task Add parts to order would order an additional item each time it was used.

This workflow pattern specifies that multiple instances of an activity should be created, each instance being synchronized and able to run concurrently.

See the table “Supported Control Flow Patterns” in the “Workflow Patterns Reference” appendix of the TIBCO ActiveMatrix BPM - BPM Concepts guide. Note that:
  • The number of instances required is known and specified at design time.
  • Each task instance has access to all the process data (data fields, parameters, and so on).
  • All the instances must be complete before the next task is started.

The following process has three activities:

There can be multiple instances of the Each Direct Debit task. This is indicated on the General tab of the Properties view:

The details are specified on the Loops tab:

The Parallel ordering setting and All flow condition means that the activity instances will be performed at the same time and will be synchronized. The number of instances is set to 3 on the right side of the Properties view.