如何在Drools决策表中使用null安全运算符 [英] How to use null safe operator in drools decision table

查看:657
本文介绍了如何在Drools决策表中使用null安全运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请让我知道如何使用.?" (空安全运算符)在决定决策表(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安全运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆