[
https://issues.redhat.com/browse/DROOLS-5981?page=com.atlassian.jira.plug...
]
Anton Tieleman commented on DROOLS-5981:
----------------------------------------
Thank you [~tari_manga] for your quick reply during the weekend! ;)
A proper reproduction is the least I can provide. I'm often on the other side and I
know how annoying it is to "guess" an issue.
I'll attach two basic DMN models that reproduce the issue. I'm not sure how useful
they are since these are models I generated in my unit tests. The tests validate the
original expression using the customer's expression engine, then convert it to FEEL
and create the most minimal DMN model so I can use the Drools engine to check whether the
results match. :)
Basically, I found this by accident since I used the extensive set of unit tests for the
client's language to validate my conversion.
DMN FEEL: arithmetic negation of function leads to null result
--------------------------------------------------------------
Key: DROOLS-5981
URL:
https://issues.redhat.com/browse/DROOLS-5981
Project: Drools
Issue Type: Bug
Components: dmn engine
Affects Versions: 7.47.0.Final
Reporter: Anton Tieleman
Assignee: Matteo Mortari
Priority: Minor
Attachments: ExpressionTest1.dmn, ExpressionTest2.dmn
I noticed that a negated expression like {{-sum( 1, 2, 3 )}} leads to a null result on
evaluation. According to section 10.3.1.2 (page 111-113) of the [DMN 1.2 specification
document|https://www.omg.org/spec/DMN/1.2/PDF] on item 26 "arithmetic negation"
it should be possible to prefix a dash to a FEEL function. However, when evaluated, this
makes the expression return null. The non-prefixed version as well as 0-expression works
as expected.
This is quite a low priority since there is an easy workaround (prefix 0). I observed
this behaviour when running an extensive set of tests to validate conversion from a custom
expression language in a client's product to DMN FEEL. I have adjusted the conversion
using the workaround.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)