Sequence flow can have skip expression and condition expression. While reading the source of
org.flowable.engine.impl.bpmn.behavior.ExclusiveGatewayActivityBehavior.leave(), I found that if skip expression is enabled, no matter what result it is evaluated, condition expression won’t be evaluated. Is this an expected behavior?
My understanding is that if skip expression is enabled and evaluated to FALSE, then condition expression should be evaluated furthermore.
The following code snippet is taken from ExclusiveGatewayActivityBehavior.java:
public void leave(DelegateExecution execution) {
…
// Determine sequence flow to take
Iterator sequenceFlowIterator = exclusiveGateway.getOutgoingFlows().iterator();
while (outgoingSequenceFlow == null && sequenceFlowIterator.hasNext()) {
SequenceFlow sequenceFlow = sequenceFlowIterator.next();String skipExpressionString = sequenceFlow.getSkipExpression(); if (!SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpressionString)) { boolean conditionEvaluatesToTrue = ConditionUtil.hasTrueCondition(sequenceFlow, execution); if (conditionEvaluatesToTrue && (defaultSequenceFlowId == null || !defaultSequenceFlowId.equals(sequenceFlow.getId()))) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Sequence flow '{}'selected as outgoing sequence flow.", sequenceFlow.getId()); } outgoingSequenceFlow = sequenceFlow; } } else if (SkipExpressionUtil.shouldSkipFlowElement(Context.getCommandContext(), execution, skipExpressionString)) { outgoingSequenceFlow = sequenceFlow; } // Already store it, if we would need it later. Saves one for loop. if (defaultSequenceFlowId != null && defaultSequenceFlowId.equals(sequenceFlow.getId())) { defaultSequenceFlow = sequenceFlow; } } ...
}