# And Rule execution

**URL:** <https://forum.flowable.org/t/and-rule-execution/7044>\
**Category:** Flowable Application\
**Created:** [November 9, 2020, 3:51am UTC](https://forum.flowable.org/t/and-rule-execution/7044 "2020-11-09T03:51:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pardeep131085](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pardeep131085](https://forum.flowable.org/u/pardeep131085)\
**Post date:** [November 9, 2020, 3:51am UTC](https://forum.flowable.org/t/and-rule-execution/7044/1 "2020-11-09T03:51:24Z")

</div>

Hi,

I have this decision table

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/5/55d8f30ddd21ae8c2895407122cbbfc7630ac36a.png)

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 ?

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [November 9, 2020, 8:39am UTC](https://forum.flowable.org/t/and-rule-execution/7044/2 "2020-11-09T08:39:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pardeep131085](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pardeep131085](https://forum.flowable.org/u/pardeep131085)\
**Post date:** [November 9, 2020, 3:27pm UTC](https://forum.flowable.org/t/and-rule-execution/7044/3 "2020-11-09T15:27:02Z")

</div>

Hi @yvo

It is \>= sign in table,I tried again I am getting both result for above input.

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [November 9, 2020, 3:34pm UTC](https://forum.flowable.org/t/and-rule-execution/7044/4 "2020-11-09T15:34:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pardeep131085](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pardeep131085](https://forum.flowable.org/u/pardeep131085)\
**Post date:** [November 9, 2020, 3:57pm UTC](https://forum.flowable.org/t/and-rule-execution/7044/5 "2020-11-09T15:57:30Z")

</div>

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](https://drive.google.com/file/d/1vjkIABAGhIiQME7S1c7pBSbABqoMvm-D/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [November 9, 2020, 6:15pm UTC](https://forum.flowable.org/t/and-rule-execution/7044/6 "2020-11-09T18:15:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pardeep131085](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pardeep131085](https://forum.flowable.org/u/pardeep131085)\
**Post date:** [November 9, 2020, 6:19pm UTC](https://forum.flowable.org/t/and-rule-execution/7044/7 "2020-11-09T18:19:35Z")

</div>

screen shot has \>= 10

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [November 9, 2020, 6:24pm UTC](https://forum.flowable.org/t/and-rule-execution/7044/8 "2020-11-09T18:24:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pardeep131085](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pardeep131085](https://forum.flowable.org/u/pardeep131085)\
**Post date:** [November 9, 2020, 6:33pm UTC](https://forum.flowable.org/t/and-rule-execution/7044/9 "2020-11-09T18:33:46Z")

</div>

Yes, - that cause the confusion.
