Exclusive
Exclusive gateways (also known as XOR gateways) specify multiple possible paths, only one of which is actually taken. All the outgoing flow paths are evaluated and the flow whose condition is evaluated to true is taken for process execution.
Exclusive gateways are used in the following two ways:
- Join: specifies the branching of the flow into multiple possible paths, or to merge these possible paths.
- Fork: specifies the possible multiple paths. The selection logic is specified in the sequence flows. One sequence flow is defined as the default.
Joining
A converging exclusive gateway is used to merge alternative paths.
Each incoming control flow token is routed to the outgoing Sequence Flow without synchronization. Each token arriving at any incoming sequence flow activates the gateway and is routed to exactly one of the outgoing sequence flows.
The Exclusive Gateway has pass-through semantics for a set of incoming branches (merging behavior). This behaves like the parallel gateway merging except that each incoming sequence requires an individual rule and the rule is satisfied with the message token coming through the sequence flow.
When an exclusive gateway is used where two or more sequence flows merge, the gateway does not impose synchronization or evaluate any sequential flow expression, it simply continues the execution to proceed to the next task after the gateway.
Forking
Gateway activation leads to the activation of exactly one out of the set of outgoing branches. The branch is determined by the if-then-else conditional logic using the information available from the sequence flows. To determine the outgoing sequence flow, the conditions are evaluated in order. The first condition that evaluates to true determines the sequence flow the token is sent to. The evaluation ceases at that point. If none of the conditions evaluates to true, the default sequence flow is taken, and if a default flow has not been specified, an exception is thrown.