Search code examples
droolsdrools-guvnor

How to use null safe operator in drools decision table


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.

enter image description here


Solution

  • 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.