Hello Drools Experts,<br><br>I have a question on activation group and trying to understand the mechanism. <br><br>I have the following rules in a .drl file :<br><br>import function com.test.utils.StringUtil.isEmpty;<br>import function com.test.utils.Logger.log;<br>
<br>rule "r1"<br> salience 10<br> activation-group "fireOnlyOnce"<br> when <br> SomeObject($s: someStringKey)<br> eval(isEmpty($s) // static java method imported as function<br> then <br> log("doSomething");<br>
end<br><br>rule "r2"<br> activation-group "fireOnlyOnce" <br>
when <br>
SomeObject($s: someStringKey)<br>
eval(checkWithDB($s) // Make a call to the DB to validate someStringKeyis valid<br>
then <br>
log("doSomething");<br>
end<br><br>In "r1" I am checking for 'someStringKey' is not null or empty. In "r2" , I am making a call to the DB to check 'someStringKey' is a valid id. During the debug,
I found out that both "r1" and "r2" is fired but only one consequence
is executed depending on the outcome of the r1. I want "r2" to fire only when "r1" evaluates to false. How can I achieve this in Drools?<br><br>Thanks for your time and appreciate your help.<br><br>