And Rule execution

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 ?

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.

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

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

screen shot has >= 10

I stand corrected; missed that.
But then it’s obvious why the 2 rules both hit? Right?

  1. age 35 >= 10 (== true). - (== true)
  2. 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.