Developer Workflow Guide > Gateways > Exclusive Gateways
  

Exclusive Gateways

Use Exclusive gateways to create multiple branches from a sequence flow and to run the objects on a single branch. The Data Integration Service runs the objects on the first branch with a sequence flow condition that evaluates to true.
The Data Integration Service evaluates the conditions on each sequence flow in the order that you specify on the outgoing gateway properties. If a condition evaluates to true, the Data Integration Service follows the branch that the sequence flow indicates and does not evaluate any other branch. If a condition evaluates to false, the Data Integration Service skips the branch and evaluates the condition on the next sequence flow. When the objects on the branch are complete, the Data Integration Service passes the data to an incoming Exclusive gateway.
You specify a default sequence flow in the gateway properties. The Data Integration Service evaluates the default sequence flow last, regardless of the order that you set for the sequence flows in the gateway properties. If no other branch on the outgoing Exclusive gateway can run, the Data Integration Service runs the branch that the default sequence flow indicates.

Exclusive Gateway Example

Add Exclusive gateways to a workflow to create branches that run exclusively of each other. When you run a workflow that contains Exclusive gateways, the Data Integration Service runs the tasks on a single branch between the gateways. Configure conditions on the outgoing sequence flows to determine the branch that the workflow follows at run time.
You can use Exclusive gateways when the path that the workflow must follow depends on the result from an upstream workflow object. For example, you might configure a workflow with a Mapping task that identifies exception records and a Human task that distributes the exception records to data stewards. If the mapping in the Mapping task does not identify exceptions, the Human task cannot distribute records. You use an exclusive gateway to create two branches for the workflow. One branch contains the Human task that can distribute the exception records. Another branch contains a Notification task that sends an email to the data stewards if the mapping source data contains no exception records.
The following image shows a workflow that contains the branches between the Exclusive gateways:
The workflow defines two branches. One branch contains a Human task. The other branch contains a Notification task that runs if the Human task cannot run. A broken line in the sequence flow to the Notification task indicates that it is the default sequence flow.
The workflow contains the following objects:
  1. 1. Start event. The Start event starts the workflow.
  2. 2. Mapping task. The Mapping task identifies a mapping that finds the exception records in a data set. The Mapping task output includes the exceptionLoadCount variable value. The Human task uses the exceptionLoadCount value to determine the number of exception records to distribute to the data stewards.
  3. 3. Exclusive gateways. The first gateway splits the sequence flow into two branches. One branch includes a Human task. The other branch includes a Notification task. The second gateway merges the branches into a single sequence flow.
  4. Note: Define a condition on the sequence flow that connects to the Human task. Configure the condition to evaluate to true if the exceptionLoadCount variable value that the Mapping task generates is greater than zero.
  5. 4. Human task. The Human task reads the exception records that the earlier mapping identified and distributes the records to data stewards for analysis.
  6. 5. Notification task. The Notification task sends an email to the data stewards to indicate that the Human task did not run.
  7. The sequence flow that connects to the Notification task is the default sequence flow. The Data Integration Service runs the Notification task if the condition on the Human task sequence flow evaluates to false.
  8. 6. End event. The End event ends the workflow.