Designing a workflow
A workflow can represent a repeatable business process. You define the process, the tasks, and other involved activities, the relationship between them, and the conditions that must be met to run each task. You define the process in terms of the workflow tools, which are the gateways, specific conditions, default flows, tasks, and message destinations as described in Workflow Palette and Tools.
- When you use a gateway, conclude the operation by pulling the paths together with the same gateway, as shown in the examples. It is needed for the different paths between the gateways to complete before the workflow continues.
- Limit workflows to approximately 15 components. Incidents can change dynamically and a large or complicated workflow might take too long and miss the changes.
- Create small workflows for simple, repeatable processes and then use these workflows as child workflows to simplify more complex workflows. It helps to limit the relative size of the workflow; however, you might want to limit the depth of nested workflows to prevent possible memory or performance issues.
- When feasible, limit the use of Message Destinations that are configured to wait for an acknowledgment. The workflow stops when it reaches the message destination and waits until the message destination receives its acknowledgment before it continues. You can also add a Timer Event to proceed to a different part of the workflow if the acknowledgment is not received in a specific length of time.
- The workflow also stops when it reaches a manual task and waits until a user marks the task as complete before it continues. If the manual task is not completed in a specific length of time, add a Timer Event to proceed to a different part of the workflow, such as a different task.
- Review your timers, especially when you use repeating noninterrupting timers, to avoid many workflow instances blocked on the closing of a task. For example, you might not want a timer to repeat every 15 minutes over too long of time if a task is never closed. Instead, set the repeating timer to a limited number of occurrences.
- Use functions in workflows to run data-gathering activities remotely and send the result back to the workflow.
- Be sure to annotate your components and connections so that the workflow is self-documenting.
The following examples show some simple workflows.
The following example has two paths that run together. It includes four tasks (A, B, C, and D) and two parallel gateways. When a rule starts the workflow, task A is added to the corresponding incident. Afterward, both the B and C tasks are added to the incident. The second parallel gateway is used to complete the circuit, which is a recommended practice. When both of the B and C tasks are completed, task D is added to the incident.
The following “exclusive gateway” example shows where you can take one path only. It includes a total of five tasks (A-E) and two exclusive gateways. When a rule starts this workflow, task A is added to the corresponding incident. In this example, it determines the city where the incident occurred. Depending on the output of Task A, Task B, C, or D is added to the incident. The gateway has a Default Flow connector to Task D so that if the city is not Boston or Cambridge, the workflow defaults to Task D.
The second exclusive gateway is used to complete the circuit, which is a recommended practice. When B, C or D is completed, task E is added to the incident.
The “inclusive gateway” example shows where you can take many paths, but only the ones that are true. After Task A is completed and the state is equal to Vermont (which is in the New England region) then both B and D are added to the incident. When both tasks are completed, Task E is added. The Region is New England connector is the default flow if the location from Task A is not New Hampshire or Vermont.
Each example with an inclusive or exclusive gateway designates a Default Flow path, which is valid when none of the conditions that are assigned to the gateway’s outputs are met. That is, none of the statements are true. A Default Flow path cannot have a condition.