Using gateways

You can control process flow using gateways.

About this task

Gateways control the divergence and convergence of sequence lines, determining branching and merging of the paths that a runtime process can take. You can think of inclusive and exclusive gateways as questions that are asked at a particular point in the process flow. The question has a defined set of alternative answers, which act as gates. The process cannot proceed until a valid answer is provided. You can model questions using Javascript conditions, which are evaluated before the process is allowed to proceed.

You can model the following types of gateways in your process diagram:

Table 1. Types of gateways that can be modeled in process diagrams
Component icon Gateway type Description
Parallel (AND) For splits: Use when you need to diverge the process along more than one path. Use a parallel gateway when you want the process to follow all available paths.

For joins: Use to converge multiple paths into a single path after each path has completed its runtime execution. Use a parallel gateway when you want to converge all available paths.

Inclusive (OR) For splits: Use when you need to diverge the process along more than one path and you want to follow one or more available paths based on conditions that you specify.

For joins: Use downstream of an inclusive split to converge or join multiple paths into a single path after all the active paths have completed their runtime execution. The inclusive join looks upstream at each path to determine if the path is active, in which case it waits. Otherwise, it passes the token through without waiting.

Exclusive (XOR) Use to model a point in the process execution where only one of several paths can be followed, depending on a condition.
Event Use to model a point in the process execution where only one of several paths can be followed, depending on events that occur. A specific event, usually the receipt of a message, determines the path that will be taken. An event gateway must be followed by a certain set of events that must be configured as described in Modeling event gateways.

Be aware of the following when using gateways:

For more information about implementing inclusive and exclusive gateways, see Example gateways.

To add gateways to a process diagram:

Procedure

  1. Drag a gateway from the palette to the process diagram.
  2. In the text box that displays over the gateway, type a name for the gateway.
  3. Using the Sequence Flow tool, create the necessary sequence lines to and from the gateway. The default sequence line is the first line that you create from the gateway to a following step. For a gateway, you can change the default flow by reordering the sequence lines in the implementation properties.
  4. Click the gateway in the process diagram and then click the General option in the properties.
  5. In the Behavior section of the general properties, click the drop-down list and select a gateway type. The other fields described in the following table are optional:
    Table 2. Optional fields in the Behavior section of the general properties
    Field Description
    Name visible By default, the name that you provide for the gateway displays in the process diagram. Disable this check box if you do not want the name displayed in the diagram.
    Presentation Icon If you want to use an icon other than the default provided by IBM® Business Process Manager, provide the pathname for the image that you want to use.
    Documentation Enter a description of the gateway.
    Gateway Type Ensure that the type of gateway you want to implement is selected from the drop-down list. The preceding table describes the types of gateways available.
  6. Configure the implementation for the gateway.
    1. For inclusive and exclusive gateways, click the Implementation tab. For each outgoing sequence line, enter the condition (in JavaScript) that controls whether the path is followed. (See Example gateways to understand the types of conditions that you can define.) Ensure that the sequence line shown as the Default Line is the one that you want the process to follow if all conditions evaluate to false. If not, use the arrow icons to move the lines until the one that you want is designated the default. (The last line in the list is the default line.) Note: Default sequence lines do not require a condition.
    2. For event gateways, see Modeling event gateways.
    3. Parallel gateways can be implemented as described in the example in the What to do next section that follows.
  7. Click Save in the main toolbar.

What to do next

To continue to build a basic BPD by following the procedures in Basic modeling tasks:

  1. Drag a gateway icon from the palette to the process diagram so that it directly precedes the Approval activity
  2. In the text box that displays over the gateway, type the name: Split and select Parallel Gateway from the available gateway types.
  3. Drag a gateway icon from the palette to the process diagram so that it immediately follows the Approval activity.
  4. In the text box that displays over the gateway, type the name: Merge and select Parallel Gateway from the available gateway types.

    Adding the parallel gateways enables you to model the Approval and Validation steps so that the process flow continues after both of these steps are complete. If you click the Implementation option in the properties for the gateways, you can see that there are no conditions for Parallel gateways, which means all paths are followed.

  5. Using the Sequence Flow tool, connect the Enter Expenses activity to the simple split and then continue to connect the process components so that your diagram looks like the following image:

    This screen capture shows all completed sequence lines for the sample business process definition.