溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

jbpm中Sequence Flow如何使用

發(fā)布時(shí)間:2021-06-23 14:05:03 來(lái)源:億速云 閱讀:360 作者:Leah 欄目:大數(shù)據(jù)

今天就跟大家聊聊有關(guān)jbpm中Sequence Flow如何使用,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

  • 并行網(wǎng)關(guān):Parallel Gateway(一入多出 gatewayDirection="Diverging")會(huì)執(zhí)行所有的路徑,此時(shí)不要在路徑上設(shè)置條件,因?yàn)闂l件不會(huì)生效

  • 條件網(wǎng)關(guān):Inclusive Gateway(一入多出 gatewayDirection="Diverging")只有路徑上的條件是true的時(shí)候才會(huì)繼續(xù)執(zhí)行

  • 聚合網(wǎng)關(guān):Inclusive Gateway(多入一出 gatewayDirection="Converging")等待多個(gè)所有的路徑都執(zhí)行完畢才會(huì)繼續(xù)向下執(zhí)行


Note:所有類(lèi)型的網(wǎng)關(guān)不可以同時(shí)擁有多個(gè)入口和多個(gè)出口 jbpm中Sequence Flow如何使用

關(guān)于Sequence Flow也就是圖中的線,當(dāng)連接的是并行網(wǎng)關(guān)的時(shí)候是沒(méi)法加condition的,condition必須要有一個(gè)true或false的返回的值,如下面的例子,使用java代碼寫(xiě)的condition(紅色部分),注意必須要return。

<sequenceFlowid="SequenceFlow_053b7wt"name="java腳本線"sourceRef="ExclusiveGateway_1wgfzzs"
targetRef="business">
<conditionExpression xsi:type="tFormalExpression">System.out.println("條件網(wǎng)關(guān)");
return true;
</conditionExpression>
</sequenceFlow>

<sequenceFlowid="SequenceFlow_0fjx8rl"name="表達(dá)式線"sourceRef="ExclusiveGateway_1wgfzzs"
targetRef="Task_014lbgb">
<conditionExpressionxsi:type="tFormalExpression">2&gt;1</conditionExpression>
</sequenceFlow>

觸發(fā)指定agenda-group的規(guī)則和ruleflow-group的規(guī)則

kieSession.getAgenda().getAgendaGroup("test").setFocus();
((InternalAgenda)kieSession.getAgenda()).activateRuleFlowGroup("test");

在jbpm中的condition expresss使用MVEL、java和表達(dá)式,最主要的是language那里的區(qū)別 DRL語(yǔ)言

<conditionExpression xsi:type="tFormalExpression"language="http://www.jboss.org/drools/rule">
com.trusfort.credit.decision.pojo.DecisionFlow(id=="1")
</conditionExpression>

當(dāng)判斷條件為map時(shí)按照如下寫(xiě)法:

java.util.HashMap(
this["a"]>1
)

java語(yǔ)言

<conditionExpressionxsi:type="tFormalExpression"
language="http://www.java.com/java">
return ture
</conditionExpression>

表達(dá)式

<sequenceFlowid="SequenceFlow_0fjx8rl"name="表達(dá)式線"sourceRef="ExclusiveGateway_1wgfzzs"
targetRef="Task_014lbgb">
<conditionExpressionxsi:type="tFormalExpression">2&gt;1</conditionExpression>
</sequenceFlow>

如果網(wǎng)關(guān)是parallel gateway(并行網(wǎng)關(guān))時(shí) 線上的條件是無(wú)效的,Inclusive gateway 和exclusive gateway 線上的條件是有效的

看完上述內(nèi)容,你們對(duì)jbpm中Sequence Flow如何使用有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注億速云行業(yè)資訊頻道,感謝大家的支持。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI