Null values in output

How can a DMN decision table contain output null values? If left empty, in org.camunda.bpm.dmn.engine.impl.DmnDecisionRuleResultImpl#getEntry a NPE is thrown if the key is not available. The only way around is to first check with method containsKey whether the key exists.

My current code is

DmnDecisionRuleResult dmnDecisionRuleResult = dmnDecisionResult.getSingleResult();
if (dmnDecisionRuleResult != null) {
String value = dmnDecisionRuleResult.containsKey(“myKey”) ? dmnDecisionRuleResult.getEntry(“myKey”) : null);
}

@Jamir it’s not required to write a rule for null output. Simply ignore the rule from Decision table rather than setting to null.

Imagine I have 2 output parameters one of which can be null. I need that rule then anyway.

1 Like