activiti网关传递判断

博客详细解析了Activiti中的四种网关类型: ExclusiveGateway(排他网关)、ComplexGateway(混合网关)、InclusiveGateway(包容网关)和ParallelGateway(并行网关)。文章通过代码示例展示了排他网关的处理逻辑,包括条件判断和流程走向的确定,为理解工作流网关的执行提供了参考。
摘要由CSDN通过智能技术生成

activiti的 GateWay类org\activiti\activiti-bpmn-model\7.1.0.M6\activiti-bpmn-model-7.1.0.M6.jar!\org\activiti\bpmn\model\Gateway.class   有4个子类

ExclusiveGateway 排他网关  ComplexGateway混合/复杂网关 InclusiveGateway包容网关  ParallelGateway并行网关  他们结构是一样的 每个都有自己的behiver 区别在处理类如何处理上

org\activiti\activiti-bpmn-model\7.1.0.M6\activiti-bpmn-model-7.1.0.M6.jar!\org\activiti\bpmn\model\InclusiveGateway.class

org\activiti\activiti-bpmn-model\7.1.0.M6\activiti-bpmn-model-7.1.0.M6.jar!\org\activiti\bpmn\model\ComplexGateway.class

org\activiti\activiti-bpmn-model\7.1.0.M6\activiti-bpmn-model-7.1.0.M6.jar!\org\activiti\bpmn\model\ParallelGateway.class

排他网关处理类

\org\activiti\activiti-engine\7.1.0.M6\activiti-engine-7.1.0.M6.jar!\org\activiti\engine\impl\bpmn\behavior\ExclusiveGatewayActivityBehavior.class

 一些关键代码

String defaultSequenceFlowId = exclusiveGateway.getDefaultFlow();
//获取所有输出线
Iterator sequenceFlowIterator = exclusiveGateway.getOutgoingFlows().iterator();

while(outgoingSequenceFlow == null && sequenceFlowIterator.hasNext()) {
    SequenceFlow 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 (log.isDebugEnabled()) {
                log.debug("Sequence flow '{}'selected as outgoing sequence flow.", sequenceFlow.getId());
            }

            outgoingSequenceFlow = sequenceFlow;
        }
    } else if (SkipExpressionUtil.shouldSkipFlowElement(Context.getCommandContext(), execution, skipExpressionString)) {
        outgoingSequenceFlow = sequenceFlow;
    }

    if (defaultSequenceFlowId != null && defaultSequenceFlowId.equals(sequenceFlow.getId())) {
        defaultSequenceFlow = sequenceFlow;
    }
}

ConditionUtil.hasTrueCondition 跳进去继续看

拿到 uel表达式 去执行判断  我们如果要手动判断经过网关后流程向哪儿走 可以参考或者调用这些逻辑

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值