javadroolsrule-engine

Drools decision table - function call for condition param, so that the condition will be evaluated by comparing the values coming from the function


In my drools decision table, I want to keep a getter or function call in the condition cell, so that the condition will be evaluated over the value coming from that getter or function. i.e for the $param, I want the cell to evaluate param value from the getter call. and then evaluate the condition.

I kept a condition as $analytics.getProp1() <= ($param) Now for this param, I want the condition cell to get the value from a function (getter call) like this $analytics.getProp2(). So that the actual evaluation will be $analytics.getProp1() <= $analytics.getProp2()

enter image description here

In the attached example, I'm trying to get the value from getProp2() and to use in for the param. What should be the correct approach.


Solution

  • I was able to resolve the issue by passing value in 1 condition cell for each row, as I needed to evaluate the condition as OR and not as AND. The issue was resolved yesterday and I forgot to post answer. Thanks for your response In the above scenario, I kept the value for both the condition in rows, however only 1 of my condition can be true at once, So I neeeded to keep the other condition value cell empty. Below is the solution image for the same.

    enter image description here

    My conditions were as if first condition is true, the other condition will be false. Since I was keeping values for both the conditions (where 1 condition was getting true while the second was false) making the rule false.