<div>Please ignore my previous email as I did not include subject.</div>
<div> </div>
<div>I have 4 drl files in my app. Loading all the 4 during application startup.<br>If any rule is satisfied in File 1,I don't want File 2 be called.Should execute File 3 and 4.<br>Similarly If rules in File 1 is not satisfied,want to call File 2 then File 3 and 4.</div>
<p>At present I am doing this way.Please let me know if this is ok or if there is any better solution.</p>
<p>Set an attribute when a rule is satisfied. (attribute is not dummy,I need it in my app)<br>Attribute is checked in each and every if it is null.</p>
<p><br>Example File1.drl contains 2 rules.If first rule is satisfied, don't want to execute second rule.So setting rule with a valid number.</p>
<p><br>File1.drl</p>
<p>rule "1.Age Factor and Junior"<br> when<br> d : CustomerDetail( rule == "" && sale == 'Junior' && age in ("16","17"))<br> then <br>
System.out.println("Junior and Age Satisfied "); <br> d.setRule("1");<br>end</p>
<p>rule "2.Junior only Age Factor"<br> when<br> m : CustomerDetail( rule == "" && age in ("16","17"))<br> then <br> System.out.println("Only junior Age satisfied.");<br>
m.setRule("2");<br>end</p>
<p> </p>
<p>File2.drl</p>
<p>rule "3.Age Factor and Senior"<br> when<br> d : CustomerDetail( rule == "" && sale == 'Senior' && age in ("70","75"))<br> then <br>
System.out.println("Senior and Age Satisfied "); <br> d.setRule("10");<br>end</p>
<p>rule "4.Senior only Age Factor "<br> when<br> m : CustomerDetail( rule == "" && age in ("70","75"))<br> then <br> System.out.println("Only senior Age satisfied.");<br>
m.setRule("11");<br>end</p>
<p>This one works but I see these disadvantages:<br>1)If the rule 1 is satisfied, rule2 is still executed.Similary all the rules in File2.drl.<br>2)Might impact performance all the 4 rules are called all time.</p>
<p>Any suggestions?</p>