You can execute any activity multiple times using the same process flow token by using the Multiple Node Instances (MNI) functionality. This allows you to design processes that handle a variety of tasks. For example, you might spawn multiple tasks for the same activity when multiple tasks are associated with a single event (such as an interview in a hiring process) or when recursively building a text document from process data.
Multiple activity instances can be executed sequentially or in parallel. Re-execution of an activity creates a new instance, even if the previous instance is not finished processing.
Parallel Execution: All instances are activated simultaneously. They do not have to complete in the same order they were activated.
Sequential Execution: The instances must be completed in the same order that they were activated.
The steps for configuring multiple node instances are listed in the Other Tab of the node's properties dialogue box.
See also: Other Tab
At times, you may need to execute an activity repeatedly by creating a loop in the process flow and routed the process flow back to the same activity to execute it again. This type of process activity execution is referred to as a looping process flow.
Looping process flows allow you to add information to existing variables and repeat an operation until it is completed.
If the activity saves data in single value variables, then the data in the variable is overwritten each time the activity is executed.
If the activity saves data in multiple value variables, you can have the activity attach its output to the end of the existing list of values — OR — You can overwrite a certain value (or record) in a list of values, by specifying its index location.
For details regarding how to append or insert data into an existing variable, see also: Creating a Custom Output
You can configure a looping process flow to spawn based on a definite number of instances or base the number on a process variable.
NOTE: If a process flow reaches a node configured to spawn a number of instances based on an array length or PV of type Number - Integer and the value at the time is empty, null, or zero, the process will pause by exception and throw an error requiring you to resume the process as needed. This type of process flow can be useful when using a sub-process to tabulate report data. When the activity is a sub-process, a new process is stared each time the activity is activated.
You can determine the number of times that a flow token repeats a loop by placing a gateway in the loop.
You can schedule a recurring execution of the same activity at given interval. For example, a manager could schedule an activity every Friday at 1:00 PM, which assigns a task to each team member regarding their expenses.
This type of process activity execution is referred to as recurrence.
When activities have been configured to execute on a recurring schedule, it is possible to manually trigger or skip a recurrence.
See also: Scheduling the Start of an Activity
When you assign a task to a group and you want all group members to respond, you can configure the same activity to automatically spawn a new task for each group member. If you have a multiple value process variable, such as a purchase order that contains three items, you can also spawn a task for each item.
This type of process activity execution is referred to as spawning.
Sequential execution is not available when executing an activity once for each item in a process variable, when the spawn new option is selected.
See also: Configuring Task Assignment
When using multiple node instances to update the values of an array, use the is stored as or the is appended to list operators in your node output.
When an activity configured to run multiple instances is part of a chain, any one of the instances is randomly selected as the next node in the chain.
In the example above, a chain is established with Node A, Node B, and Node C. Node A and C are regular tasks, while Node B is configured to run multiple instances - one instance for each assignee.
Upon completion of Node A, any one instance of Node B appears. If three instances of Node B are spawned, any one of those 3 instances may appear as the next task in the chain after Node A has been completed.
Upon completion of Node B, the task for Node C appears. If the "Allow users to step back to this node from the next chained activity" option is selected on Node A, B, and C, you can step back and forth between Node A, B, and C any number of times.
If you complete Node A and B and while viewing the task form for Node C, and you step back to B, all information entered in Node B appears on the task form for Node B.
If then you decide to step back from Node B to Node A, all information entered in Node A appears on the task form. In this case, the completed instance of Node B is deleted from the system. When you click "Next" to move to Node B, a new task form appears. Previously entered data will be lost. If any of the nodes (A, B, or C) do not have the "Allow users to step back to this node from the next chained activity" checkbox selected, a "Back" button does not appear in the next task form. You are not able to navigate back to the previous task.
This example assumes that the "Override assignment for the next attended activity even if the current user is not an assignee." flag is enabled in all chained flows.
When an activity that is scheduled to run periodically is part of a chain, the first instance is chained. All subsequent instances are not part of an activity-chain.