I have around 8 to 9 conditions. Around 12 rules in each drl file(files &rules will grow). This will make rule file complicated.<br><br>
<div class="gmail_quote">On Mon, Nov 23, 2009 at 1:19 PM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Best to specify all conditions in full, with all relevant properties,<br>i.e., add sale != "Junion"/"Senior" in rules 2 and 4.<br>
-W<br>
<div>
<div></div>
<div class="h5"><br><br><br><br>On 11/23/09, Lindy hagan <<a href="mailto:lindyhagan@gmail.com">lindyhagan@gmail.com</a>> wrote:<br>> I have 4 drl files in my app. Loading all the 4 files during application<br>> startup.<br>
> If any rule is satisfied in File 1,I don't want File 2 be called.Should<br>> execute File 3 and 4.<br>> If rules in File 1 is not satisfied,want to call File 2 then File 3 and 4.<br>><br>> At present I am doing this way.Please let me know if this is ok or if there<br>
> is any better solution.<br>><br>> Set an attribute when a rule is satisfied. (attribute is not dummy,I need it<br>> in my app)<br>> Attribute is checked in each and every if it is null.<br>><br>><br>
> Example File1.drl contains 2 rules.If first rule is satisfied, don't want to<br>> execute second rule.So setting rule with a valid number.<br>><br>><br>> File1.drl<br>><br>> rule "1.Age Factor and Junior"<br>
> when<br>> d : CustomerDetail( rule == "" && sale == 'Junior' && age in<br>> ("16","17"))<br>> then<br>> System.out.println("Junior and Age Satisfied ");<br>
> d.setRule("1");<br>> end<br>><br>> 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<br>><br>><br>><br>> File2.drl<br>><br>> rule "3.Age Factor and Senior"<br>
> when<br>> d : CustomerDetail( rule == "" && sale == 'Senior' && age in<br>> ("70","75"))<br>> then<br>> System.out.println("Senior and Age Satisfied ");<br>
> d.setRule("10");<br>> end<br>><br>> 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<br>><br>> This one works but is it possible , If the rule 1 is satisfied, rule2 is<br>
> still executed.Is there any way we can stop rule2 from beinge executed?<br>> Similary stop File2.drl being executed. Any suggestions?<br>><br></div></div>_______________________________________________<br>rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote>
</div><br>