[jboss-jira] [JBoss JIRA] (DROOLS-5102) DMN npe when xml defines empty default expression for DT

Matteo Mortari (Jira) issues at jboss.org
Fri Feb 21 17:40:00 EST 2020


    [ https://issues.redhat.com/browse/DROOLS-5102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13979975#comment-13979975 ] 

Matteo Mortari commented on DROOLS-5102:
----------------------------------------

Ciao [~eromano-1] , thank you very much for reporting!

Actually, there were several problems in your original DMN file, which from my perspective made the file non-spec-compliant:
* line 28: "The OutputClause of a single output decision table SHALL NOT specify a typeRef."
* line 28: "The OutputClause of a single output decision table SHALL NOT specify a name."
* line 63: my understanding from the spec this variable shall be given the same name of the Decision (DRGElement) it belongs to; hence this variable should have been named {{name="Decision_decisionboolean"}}

That said, the blocking issue at play here was that the DMN model file seems trying to define a default output entry (to be used when Unique DT does not match any rule, for instance) but this default output entry was "none".
See Line30.
Based on this decision table design, we could expect either {{true}} or {{false}} could be reasonable default output entry, when any other rule would not have matched.
Please notice, if the desire was to have the default to be null, Line 30 should have specified {{<text>null</text>}} instead.
Line30, originally in this file, is a none expression, which is a bit strange.

On other hand, and as you reported, it was not good that the Drools DMN engine was throwing the NPE during evaluation/execution, and I just raised a PR to fix this specific problem.

The other problems of the file are a modeler/editor issue, which from my perspective is creating a file failing to be fully compliant DMN-spec-compliant model, as explained above; you may also want to consider exporting DMN to the newest version available if possible, which is DMNv1.2 ;)

Hope this helps, thank you again for reporting!


> DMN npe when xml defines empty default expression for DT
> --------------------------------------------------------
>
>                 Key: DROOLS-5102
>                 URL: https://issues.redhat.com/browse/DROOLS-5102
>             Project: Drools
>          Issue Type: Bug
>          Components: dmn engine
>    Affects Versions: 7.33.0.Final
>            Reporter: Eugenio Romano
>            Assignee: Matteo Mortari
>            Priority: Critical
>         Attachments: different-all.dmn
>
>
> If you execute the DMN table in attach in the last version you will have a NullPointerException in case your input value is not matching any output.
> We are moving from version 23 to 33 and one of our tests are catching this issue
> The ProcessedExpression Class seems can be responsible of causing this NullPointerException.
> {code:java}
> this.ast = (BaseNode)tree.accept(new ASTBuilderVisitor(ctx.getInputVariableTypes(), ctx.getFEELFeelTypeRegistry()))
> {code}
> If you try with 
> "inputString", "hi"
> "inputInteger", 12
> "inputBoolean", false
> "inputDate", "2019-09-26T00:00:00.000+0000"
> you can replicate the error
> I guess the expected behavior should be a null output as before



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list