日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

flowable DMN规则引擎几种类型解释_04

發布時間:2024/9/27 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 flowable DMN规则引擎几种类型解释_04 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文章目錄

          • 單一命中
            • 第一個(FIRST)
            • 唯一(UNIQUE)
            • 優先級(PRIORITY)
            • 任何(ANY)
          • 多重命中
            • 輸出順序(OUTPUT ORDER)
            • 規則順序(RULE ORDER)
            • 采集(COLLECT)

項目地址:https://gitee.com/lwj/flowable.git 分支flowable-base
視頻地址:https://www.bilibili.com/video/av79774697/
*業務場景:
往往在我們實際業務中,規則異常重要,比方說輸入一批數據得到某些結果數據,從而來簡化我們的BPMN流程圖,
*

flowableDMN規則引擎幾種類型解釋

單一命中
第一個(FIRST)

可以匹配多個(重疊)具有不同輸出條目的規則。返回規則順序中的第一次命中(返回后停止評估)。

唯一(UNIQUE)

沒有重疊的可能,所有規則都是互斥的。只能匹配到一條規則。
如果多個會報錯
可以利用設置解決這個問題
dmnEngine.getDmnEngineConfiguration().setStrictMode(false);

優先級(PRIORITY)

具有不同的輸出條目的多個規則可以匹配。此策略返回具有最高輸出優先級的匹配規則。輸出優先級在輸出值的有序列表中按優先級遞減的順序指定。當禁用strict mode且未定義輸出值時,結果是最后一個有效規則。(違規將以驗證消息的形式出現)

任何(ANY)

可能會有重疊,但如果所有匹配規則顯示每個輸出的輸出條目相等,就可以使用任何匹配。如果輸出條目不相等,則命中策略不正確,結果將為空并標記為failed。當禁用strict mode時,結果是最后一個有效規則。(違規將以驗證消息的形式出現)

多重命中
輸出順序(OUTPUT ORDER)

按輸出優先級遞減的順序返回所有命中規則。輸出優先級在輸出值的有序列表中按優先級遞減的順序指定。

規則順序(RULE ORDER)

按規則順序返回所有命中

1、疊加變量 ${output1 + 10} 2、包含 任意都在 輸入: List inputVariable1 = Arrays.asList("test1", "test2", "test3"); processVariablesInput.put("collection1", inputVariable1); 輸出: test2 or test5 in collection1 ${collection:containsAny(collection1, '"test2", "test5"')} 3、傳入對象 輸入: Person customerOne = new Person(); customerOne.setName("test1"); customerOne.setAge(10L); processVariablesInput.put("customerOne", customerOne); 輸出:${collection:contains("test1", customerOne.name)} 4、json傳入匹配 IN 兩個并且都在 輸入: ArrayNode arrayNode1 = objectMapper.createArrayNode().add("test1").add("test2").add("test3"); processVariablesInput.put("arrayNode1", arrayNode1); 輸出:"test1 and test2 in arrayNode1" ${collection:contains(arrayNode1, '"test1", "test2"')} 5、不包含 任意都不在 傳入: List inputVariable1 = Arrays.asList("test1", "test2", "test3"); processVariablesInput.put("collection1", inputVariable1); 表達式:test3 and / or test6 not in collection1 ${collection:notContainsAny(collection1, '"test3", "test6"')} 6、不包含 not in 兩個并且都不在 輸入: List inputVariable1 = Arrays.asList("test1", "test2", "test3"); processVariablesInput.put("collection1", inputVariable1); 輸出: test3 and test5 not in collection1 ${collection:notContains(collection1, '"test3", "test5"')}

1、疊加變量
${output1 + 10}
2、包含 任意都在
輸入:
List inputVariable1 = Arrays.asList(“test1”, “test2”, “test3”);
processVariablesInput.put(“collection1”, inputVariable1);
輸出:
test2 or test5 in collection1
collection:containsAny(collection1,′“test2”,“test5”′)3、傳入對象輸入:PersoncustomerOne=newPerson();customerOne.setName(“test1”);customerOne.setAge(10L);processVariablesInput.put(“customerOne”,customerOne);輸出:collection:containsAny(collection1,

“test2”,“test5”

)3、傳入對象輸入:PersoncustomerOne=newPerson();customerOne.setName(“test1”);customerOne.setAge(10L);processVariablesInput.put(“customerOne”,customerOne);輸出:{collection:contains(“test1”, customerOne.name)}
4、json傳入匹配 IN 兩個并且都在
輸入:
ArrayNode arrayNode1 = objectMapper.createArrayNode().add(“test1”).add(“test2”).add(“test3”);
processVariablesInput.put(“arrayNode1”, arrayNode1);
輸出:“test1 and test2 in arrayNode1”
${collection:contains(arrayNode1, ‘“test1”, “test2”’)}
5、不包含 任意都不在
傳入:
List inputVariable1 = Arrays.asList(“test1”, “test2”, “test3”);
processVariablesInput.put(“collection1”, inputVariable1);
表達式:test3 and / or test6 not in collection1
${collection:notContainsAny(collection1, ‘“test3”, “test6”’)}
6、不包含 not in 兩個并且都不在
輸入:
List inputVariable1 = Arrays.asList(“test1”, “test2”, “test3”);
processVariablesInput.put(“collection1”, inputVariable1);
輸出:
test3 and test5 not in collection1
${collection:notContains(collection1, ‘“test3”, “test5”’)}
1、疊加變量
${output1 + 10}
2、包含 任意都在
輸入:
List inputVariable1 = Arrays.asList(“test1”, “test2”, “test3”);
processVariablesInput.put(“collection1”, inputVariable1);
輸出:
test2 or test5 in collection1
collection:containsAny(collection1,′“test2”,“test5”′)3、傳入對象輸入:PersoncustomerOne=newPerson();customerOne.setName(“test1”);customerOne.setAge(10L);processVariablesInput.put(“customerOne”,customerOne);輸出:collection:containsAny(collection1,

“test2”,“test5”

)3、傳入對象輸入:PersoncustomerOne=newPerson();customerOne.setName(“test1”);customerOne.setAge(10L);processVariablesInput.put(“customerOne”,customerOne);輸出:{collection:contains(“test1”, customerOne.name)}
4、json傳入匹配 IN 兩個并且都在
輸入:
ArrayNode arrayNode1 = objectMapper.createArrayNode().add(“test1”).add(“test2”).add(“test3”);
processVariablesInput.put(“arrayNode1”, arrayNode1);
輸出:“test1 and test2 in arrayNode1”
${collection:contains(arrayNode1, ‘“test1”, “test2”’)}
5、不包含 任意都不在
傳入:
List inputVariable1 = Arrays.asList(“test1”, “test2”, “test3”);
processVariablesInput.put(“collection1”, inputVariable1);
表達式:test3 and / or test6 not in collection1
${collection:notContainsAny(collection1, ‘“test3”, “test6”’)}
6、不包含 not in 兩個并且都不在
輸入:
List inputVariable1 = Arrays.asList(“test1”, “test2”, “test3”);
processVariablesInput.put(“collection1”, inputVariable1);
輸出:
test3 and test5 not in collection1
${collection:notContains(collection1, ‘“test3”, “test5”’)}

采集(COLLECT)

以任意順序返回所有命中。我們可以添加運算符(+,<,>,#)來將一個簡單函數應用于輸出。如果沒有運算符,則結果是所有輸出條目的列表。

+(總和):決策表的結果是所有不同輸出的總和。

<(最小值):決策表的結果是所有輸出中的最小值。

‘>(最大值):決策表的結果是所有輸出中的最大值。

#(計數):決策表的結果是不同輸出的數量。

總結

以上是生活随笔為你收集整理的flowable DMN规则引擎几种类型解释_04的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。