xmlns="urn:jbpm.org:jpdl-3.2" name="test6">
在开始节点往下流转到decision1时,当days变量大于10时,就自动再流转到李四审批,否则流转到王五审批。
当条件判断非常复杂时,就需要使用DecisionHandler
xmlns="urn:jbpm.org:jpdl-3.2" name="test7">
public class MyDecisionHandler implements DecisionHandler { /** Comment for serialVersionUID */ private static final long serialVersionUID = -6140889082116291459L; @Override public String decide(ExecutionContext executionContext) throws Exception { long days = (Long) executionContext.getContextInstance() .getVariable("days"); if (days > 10) { return "提交给李四审批"; } else { return "提交给王五审批"; } } }
serialVersionUID
十七、Decision节点和DecisionHandler的使用