Architecting and designing : Business Process Analysis (BPA) : BPMN : Modeling Gateways on BPMN diagrams : Expressing exclusive decisions and merges (XOR)
  
Expressing exclusive decisions and merges (XOR)
To express exclusive decisions and merges (otherwise known as XOR), you use either the gateway symbol without specifying a stereotype, or you use the gateway symbol with the XOR stereotype.
To model a data-based XOR decision
1 Use the Gateway symbol, and either specify no stereotype (which provides the default diamond symbol) or specify a stereotype of XOR.
2 Connect two or more outgoing Sequence Flows from the XOR gateway to respective process symbols.
3 In each Sequence Flow’s definition, go to the Execution (Condition) tab and type the Condition for the Sequence Flow to be chosen. Only one flow can be taken during the performance of the Process Flow. Once you place any text in the Condition property of the Sequence Flow, the flow itself will be notated with a white diamond at its starting point.
Each outgoing Sequence Flow is considered an alternative gate. The conditions on the alternative gates are evaluated in the specific order in which you have drawn them, from top to bottom. The first one that evaluates True will be the Sequence Flow that the Token flows out on. Any other Sequence Flows whose condition evaluates True will be ignored. In fact, as soon as a Sequence Flow evaluates True, the conditions of the other Sequence Flows are not even evaluated.
4 Specify a default outgoing sequence flow:
You can also specify a Default outgoing Sequence Flow path on the Sequence Flow line. Open the definition dialog of the Sequence Flow, and in its Symbol tab, set its Default property to be True. This means that if the conditions on all alternative flows evaluate False, then the Default path is taken. According to BPMN, it is not mandatory to specify a default outgoing Sequence Flow. This means that if you do not specify a default outgoing Sequence Flow, you must ensure that the condition on at least one of the other Sequence Flows evaluate true. If you do not, you have an invalid model.
Note A data-based XOR gateway can have both multiple incoming and multiple outgoing Sequence Flows.
The following diagram shows an example of a Data-Based XOR Decision.
Modeling a data-based XOR merge
A Data-Based XOR merge occurs when only one of the input Sequence Flows is used to continue the flow of the process. Process flow continues when the first signal (a Token) arrives from any of the set of input Sequence Flows. Signals from other input Sequence Flows that arrive afterwards are not used to continue the flow of the process.
To model a Data-Based XOR merge
1 Draw a gateway, and specify its stereotype as XOR.
2 Draw two or more Sequence Flows into the gateway. Draw one output Sequence Flow from the gateway to its process.
3 Do not specify the Condition property on any of the Sequence Flows.
The following diagram shows an example of a Data-Based XOR merge.
Modeling an event-based XOR decision
To model an event-based XOR decision, you need to draw an event-based gateway, and then draw Sequence Flows out of the gateway that connect to event symbols that determine the flow.
To model an event-based XOR decision
1 Draw a Gateway symbol, and specify a stereotype of event based.
2 For each outgoing Sequence Flow that you plan to draw out of the event-based gateway, first draw an applicable event symbol that will be associated with that Sequence flow, such as a message event, a timer, an exception, etc.
3 Draw an outgoing Sequence Flow from the event-based gateway to each associated event.
4 Do not specify a condition expression for the Sequence Flow. In the Symbol tab of each Sequence Flow, ensure that the Condition property is blank.
The event-based gateway is pictured above. You must connect at least two outgoing Sequence Flows to it. According to BPMN, the event-based gateway cannot be used as a merge gateway (in other words, you should not draw more than one Sequence Flow into it and only one Sequence Flow out of it). It can only be used as a decision type gateway (multiple outputs).
Example
See also
Modeling Gateways on BPMN diagrams