Hi,
I have this decision table
Trying to evaluate age>35 and days >18 condition.
When I use this request
{
"decisionKey": "TEST_RULE",
"inputVariables" : [
{
"name":"age",
"value":"35"
},
{
"name":"days",
"value":"20"
}
]
}
I am getting both the output in my result. Is that expected? what I need to do to expect only 2nd response ?
yvo
November 9, 2020, 8:39am
2
Hi @pardeep131085
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.
Yvo
Hi @yvo
It is >= sign in table,I tried again I am getting both result for above input.
yvo
November 9, 2020, 3:34pm
4
Hi,
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.
Yvo
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
yvo
November 9, 2020, 6:15pm
6
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.
Yvo
yvo
November 9, 2020, 6:24pm
8
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.