Implementing exclusive gateways

An exclusive gateway controls the divergence of a sequence flow by determining the branching of the paths that the flow can take at run time. When you add an exclusive gateway to your human service or service flow, you model a point in the execution of the service flow where only one of several paths can be followed, depending on a condition.

About this task

To model an exclusive gateway, you define JavaScript conditions that evaluate to true or false in the implementation properties of the gateway. The conditions that you define for the sequence flow lines that emerge from the exclusive gateway determine the path that the flow follows. The flow follows the first condition that evaluates to true. If all conditions evaluate to false, the flow follows the default sequence flow, which does not have a condition. The default sequence flow is the first sequence flow that you create from the gateway to a following activity. You can change the default sequence flow at any time. For examples of exclusive gateways that are implemented in a client-side human service or a business process definition (BPD), see the Sample exclusive gateways section in the Example gateways topic.

To add an exclusive gateway to a human service or service flow:

Procedure

  1. Open the appropriate service in the Designer view.
  2. In the Diagram view, add an exclusive gateway Exclusive Gateway tool to the canvas, and wire it to create the required sequence flow.
    The default sequence flow, which is marked with a forward slash (/) sign on the diagram, is the first sequence that you create from the gateway to a following activity.
  3. Click the gateway in the diagram. In the General common properties, specify a name and a description for the gateway.
  4. Switch to Implementation. Under Decisions, specify a condition (in JavaScript) for each outgoing sequence line to control which path is followed.
  5. Ensure that the default sequence flow under Default Flow is the one that you want the flow to follow if all conditions evaluate to false. If not, in the list select the sequence flow that you want to designate as the default sequence flow.
    Note that the default sequence flow does not have a condition.
  6. Click a sequence line and verify its implementation in the General properties. If you do not want the sequence line name to be displayed in the diagram, clear Name Visible.
  7. Click Save or Finish Editing.