问题描述
请让我知道如何使用.?" (空安全运算符)在决定决策表(Spreadsheet)中.附加了我的电子表格,对于mdcl对象,我需要在其中添加null安全运算符.请告诉我是否需要添加其他信息,因为我是Drools的新手.
Please let me know how to use ".?" (null safe operator) in drools decision table(Spreadsheet). Attached my spreadsheet, where for mdcl object I need to add null safe operator. Please let me know if I need to add additional information, as I'm new to Drools.
推荐答案
Drools中的空安全运算符为!.
,而不是.?
-请参见文档.您可以像在编写规则时一样在决策表中使用它.
The null-safe operator in Drools is !.
, not .?
- see the documentation. You can use it inside decision tables just as you would when writing rules.
在您的示例中,将条件从mdcl.MDCL_Health.get("MDCL").Value
更改为mdcl!.MDCL_Health.get("MDCL").Value
以仅在mdcl
不为null时触发规则.
In your example, change the condition from mdcl.MDCL_Health.get("MDCL").Value
to mdcl!.MDCL_Health.get("MDCL").Value
to only fire the rule if mdcl
is not null.
这篇关于如何在Drools决策表中使用null安全运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!