[jboss-jira] [JBoss JIRA] (DROOLS-1432) Improve error messages when compiling models with errors

Edson Tirelli (JIRA) issues at jboss.org
Sun Feb 12 14:56:00 EST 2017


    [ https://issues.jboss.org/browse/DROOLS-1432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13362264#comment-13362264 ] 

Edson Tirelli commented on DROOLS-1432:
---------------------------------------

Work in progress on this PR:

https://github.com/droolsjbpm/kie-dmn/pull/35

The engine is now reporting FEEL compilation errors, like unknown variables and syntax errors. The example from the test case in the PR, generates the following error messages:

* In the input clause, the string "None" is missing the double quotes, making the engine interpret it as a variable that does not exist:

bq. Error compiling FEEL expression '"Gold","Silver",None' on decision table 'Car Damage Responsibility', input clause #1: Unknown variable 'None'

* Same problem with the string "3rd Party", that without quotes is not a valid FEEL syntax, resulting in the following error:

bq. Error compiling FEEL expression 'Driver,3rd Party' on decision table 'Car Damage Responsibility', input clause #2: invalid syntax

* Here is similar error on the rule itself. The message points to the offending rule and the DMNMessage object contains the ID of the actual element:

bq. Error compiling FEEL expression 'Gold' on decision table 'Car Damage Responsibility', rule #1: Unknown variable 'Gold'

Here is the "toString()" of all the error messages generated from that example:

{quote}DMNMessage{ severity=ERROR, message='Error compiling FEEL expression '"Gold","Silver",None' on decision table 'Car Damage Responsibility', input clause #1: Unknown variable 'None'', sourceId='_46431f75-29fd-4562-8110-63f571b591b0', exception='', feelEvent=''}
DMNMessage{ severity=ERROR, message='Error compiling FEEL expression 'Driver,3rd Party' on decision table 'Car Damage Responsibility', input clause #2: invalid syntax', sourceId='_b7372019-823a-4b8c-bce4-36ef71184397', exception='', feelEvent='SyntaxErrorEvent : no viable alternative at input ',''}
DMNMessage{ severity=ERROR, message='Error compiling FEEL expression 'Gold' on decision table 'Car Damage Responsibility', rule #1: Unknown variable 'Gold'', sourceId='_7844015a-db0f-4c84-b80d-a6467dd16b6e', exception='', feelEvent=''}
DMNMessage{ severity=ERROR, message='Error compiling FEEL expression 'Silver' on decision table 'Car Damage Responsibility', rule #2: Unknown variable 'Silver'', sourceId='_a5653c63-bbae-47f5-b80c-34f2efbca467', exception='', feelEvent=''}
DMNMessage{ severity=ERROR, message='Error compiling FEEL expression '3rd Party' on decision table 'Car Damage Responsibility', rule #2: invalid syntax', sourceId='_a5653c63-bbae-47f5-b80c-34f2efbca467', exception='', feelEvent='SyntaxErrorEvent : no viable alternative at input '[3rd''}
DMNMessage{ severity=ERROR, message='Error compiling FEEL expression 'Tires' on decision table 'Car Damage Responsibility', rule #2: Unknown variable 'Tires'', sourceId='_a5653c63-bbae-47f5-b80c-34f2efbca467', exception='', feelEvent=''}
{quote}

> Improve error messages when compiling models with errors
> --------------------------------------------------------
>
>                 Key: DROOLS-1432
>                 URL: https://issues.jboss.org/browse/DROOLS-1432
>             Project: Drools
>          Issue Type: Bug
>          Components: dmn engine
>    Affects Versions: 7.0.0.Beta6
>            Reporter: Edson Tirelli
>            Assignee: Edson Tirelli
>             Fix For: 7.0.0.Final
>
>         Attachments: car_damage_responsibility2.dmn
>
>
> When a model contains errors that prevent compilation, the engine should provide a better error message pointing to the specific error.
> At the moment, the attached model fails with a NPE and a message:
> {quote}Message [id=1, kieBase=defaultKieBase, level=ERROR, path=car_damage_responsibility2.dmn, line=-1, column=0 text=Unable to compile DMN model for the resource]{quote}



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list