设置启动变量
variables.put("_ACTIVITI_SKIP_EXPRESSION_ENABLED", true);
条件设置
Map<String, Object> variables = new HashMap<>();
variables.put("input", "right");
variables.put("skipLeft", true);
variables.put("skipRight", false);
流程图设置
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="task1" activiti:skipExpression="${skipLeft}">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${input == 'left'}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow2" sourceRef="theStart" targetRef="task2" activiti:skipExpression="${skipRight}">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${input == 'right'}]]>
</conditionExpression>
</sequenceFlow>
看到上面的设置是input=‘right’ 但是由于我们已经设置自动跳过skipLeft为true 所以如论参数如何都会走left分支