问题
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.
回答1:
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.
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.
来源:https://stackoverflow.com/questions/29947371/how-to-use-null-safe-operator-in-drools-decision-table