Exclusive Gateway (XOR)
Routes execution to exactly one outgoing path based on conditions.
<exclusiveGateway id="checkAmount" name="Amount OK?" default="rejectFlow" />
<sequenceFlow id="approveFlow" sourceRef="checkAmount" targetRef="approve">
<conditionExpression>${amount} > 0</conditionExpression>
</sequenceFlow>
<sequenceFlow id="rejectFlow" sourceRef="checkAmount" targetRef="reject" />Decision algorithm
The engine evaluates outgoing flows in document order:
- For each flow that has a condition expression: evaluate the condition against current variables
- The first flow whose condition evaluates to
trueis taken — remaining flows are not evaluated - If no conditional flow matched and an unconditioned flow exists, that flow is taken
- If no conditional flow matched but a default flow is configured (
defaultattribute), the default flow is taken - If nothing matched: the instance transitions to
Failedwith aNoMatchingConditionerror
Order matters. Conditions are evaluated in the order they appear in the XML, so place more specific conditions before broader ones.
Condition expression syntax
Operators: == != > < >= <= && || !
Variable reference:
${varName} or varName
Literal values:
"string" 'string' 123 3.14 true false null
Examples:
${amount} > 0
status == 'approved' && amount < 1000
!rejectedType coercion rules:
"42" == 42→true(string coerced to number for comparison)2 == 2.0→true(integer and float compared as float)- An undefined variable evaluates to
false(logged as a warning)
Last updated on