Implementing exclusive gateways in client-side human services

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 client-side human service, 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 client-side human service, complete the following steps:

Procedure

  1. Open the appropriate client-side human service in the Designer view.
  2. In the Diagram view, drag the Exclusive gateway tool Exclusive gateway tool from the palette onto the diagram.
  3. Wire the gateway in the service flow to create the required sequence flow to and from the gateway, as shown in the following example.
    Note that the following implementation is provided just as an example. You can use a different implementation that meets your business requirements.
    Client-side human service diagram that shows the implementation of an exclusive gateway in a client-side human service flow. In the diagram, the exclusive gateway is connected to the coach and to the called service. The sequence line to the called service indicates the default sequence flow. The coach and the called service are connected to the end node.
    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.
  4. Click the gateway in the diagram. In the General properties, under Common, specify a name and provide a description for the gateway.
  5. Click the Implementation tab. Under Decisions, specify a condition (in JavaScript) for each outgoing sequence line to control which path is followed.
  6. 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: The default sequence flow does not have a condition.
  7. Click a sequence line and verify its implementation on the Flow tab. If you do not want the sequence line name to be displayed in the diagram, under Common clear Name Visible.
  8. Click Save all in the main toolbar to save the gateway configuration.