Question about skip expression of sequence flow outgoing from ExclusiveGateway

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;
    }
}
...

}

From looking at the code, it seems to work as follows:

  • if the skipExpression is enabled, the ‘else if’ part will be taken:
  • if the shouldSkipFlowElement evaluates to false, the sequence flow is not selected as outgoing.
  • If true, it will be selected as the outgoing sequence flow for the gateway

Which means that a skip expression can be used to force a sequence flow to be taken, irregardless of its condition. So in that way, the skip expression takes precedence over the regular condition.

Thanks for your reply.
In other words, if the skipExpression is enabled, condition will be ignored. And whether the sequence flow will be selected as outgoing flow is determined by skipExpression’s evaluation result.
In this sense, the skipExpression controls both condition expression and outgoing sequence flow. Is this understanding right?
Maybe I misunderstood the skipExpression by the following comment within the method of org.flowable.engine.impl.agenda.TakeOutgoingSequenceFlowsOperation.leaveFlowNode():

    } else if (flowNode.getOutgoingFlows().size() == 1 || SkipExpressionUtil.shouldSkipFlowElement(commandContext, execution, skipExpressionString)) {
        // The 'skip' for a sequence flow means that we skip the condition, not the sequence flow.
        outgoingSequenceFlows.add(sequenceFlow);
    }