Note:全部類型的網關不能夠同時擁有多個入口和多個出口
java
關於Sequence Flow也就是圖中的線,當鏈接的是並行網關的時候是無法加condition的,condition必需要有一個true或false的返回的值,以下面的例子,使用java代碼寫的condition(紅色部分),注意必需要return。express
<sequenceFlowid="SequenceFlow_053b7wt"name="java腳本線"sourceRef="ExclusiveGateway_1wgfzzs" targetRef="business"> <conditionExpression xsi:type="tFormalExpression">System.out.println("條件網關"); return true; </conditionExpression> </sequenceFlow> <sequenceFlowid="SequenceFlow_0fjx8rl"name="表達式線"sourceRef="ExclusiveGateway_1wgfzzs" targetRef="Task_014lbgb"> <conditionExpressionxsi:type="tFormalExpression">2>1</conditionExpression> </sequenceFlow>
觸發指定agenda-group的規則和ruleflow-group的規則segmentfault
kieSession.getAgenda().getAgendaGroup("test").setFocus(); ((InternalAgenda)kieSession.getAgenda()).activateRuleFlowGroup("test");
在jbpm中的condition expresss使用MVEL、java和表達式,最主要的是language那裏的區別
DRL語言this
<conditionExpression xsi:type="tFormalExpression"language="http://www.jboss.org/drools/rule"> com.trusfort.credit.decision.pojo.DecisionFlow(id=="1") </conditionExpression>
當判斷條件爲map時按照以下寫法:spa
java.util.HashMap( this["a"]>1 )
java語言code
<conditionExpressionxsi:type="tFormalExpression" language="http://www.java.com/java"> return ture </conditionExpression>
表達式orm
<sequenceFlowid="SequenceFlow_0fjx8rl"name="表達式線"sourceRef="ExclusiveGateway_1wgfzzs" targetRef="Task_014lbgb"> <conditionExpressionxsi:type="tFormalExpression">2>1</conditionExpression> </sequenceFlow>
若是網關是parallel gateway(並行網關)時 線上的條件是無效的,Inclusive gateway 和exclusive gateway 線上的條件是有效的blog