I have this decision table
Trying to evaluate age>35 and days >18 condition.
When I use this request
"inputVariables" : [
I am getting both the output in my result. Is that expected? what I need to do to expect only 2nd response ?
When I execute your request against a table like shown above I do not get any results.
As expected; no rules hit.
Rule 1 is invalid because age is not 10. Rule 2 is invalid because days is not 18.
It is >= sign in table,I tried again I am getting both result for above input.
I missed the
>=. But then only the second rule should of course be returned.
Can you provide a complete unit test? Because I can’t reproduce this.
I just have created the above rule in decision table and using the rest api to call it.
here is the link to dmn file in case - https://drive.google.com/file/d/1vjkIABAGhIiQME7S1c7pBSbABqoMvm-D/view?usp=sharing
The DMN file you shared has ;
>= 10 as the age expression on rule 1.
This is not the same as the screenshot you shared.
That causes the 2 results.
I stand corrected; missed that.
But then it’s obvious why the 2 rules both hit? Right?
- age 35 >= 10 (== true). - (== true)
- age 35 >= 35 (== true). days 20 >= 18 (==true)
Does the ‘-’ dash operator causes the confusion? This always resolves the expression to true.
Yes, - that cause the confusion.