<div>Thanks, however I am still not sure how that reuses a certain rule. Or are you saying I can write another rule just like "pay validation" where:</div>
<div> </div>
<div>rule "do something"<br>no-loop true<br> when<br> ## Some Rule Matching </div>
<div> then<br> drools.setFocus("rule test 1");<br>end<br> </div>
<div>.... and that's how I obtain the reuse of "rule test 1"?</div>
<div> </div>
<div> </div>
<div>Roger</div>
<div> </div>
<div> </div>
<div><br><br> </div>
<div><span class="gmail_quote">On 7/25/08, <b class="gmail_sendername">Vanina Beraudo</b> <<a href="mailto:vaninaberaudo@gmail.com">vaninaberaudo@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Itīs a simple example, I have a rule and it call others two rules.<br>I hope help you.<br><br>rule "rule test 1"<br>
no-loop true<br>agenda-group "rule test 1"<br> when<br> $p:Pay($fields:fields)<br> eval((Double)$fields.get("amount") < 100)<br> then<br> System.out.println( "The amount should be > 100" );<br>
end<br><br><br>rule "rule test 2"<br>no-loop true<br>agenda-group "rule test 2"<br><br> when<br> $p:Pay($fields:fields)<br> eval((Double)$fields.get("amount")> 200)<br>
then<br> System.out.println( "The amount should be < 200" );<br>end<br><br><br>rule "pay validation"<br>no-loop true<br> when<br> $p:Pay($fields:fields)<br> eval((Double)$fields.get("amount")> 0)<br>
then<br> drools.setFocus("rule test 1");<br> drools.setFocus("rule test 2");<br> System.out.println( "The amount should be in the rank [100-200] ");<br>
end<br><br><br><br><br>2008/7/25 Roger Tanuatmadja <<a href="mailto:rogerst@gmail.com">rogerst@gmail.com</a>>:<br>> Hi ideally yes, because it makes it easy to show our business users what's<br>> going on as opposed to having to decipher the flow based on some attributes,<br>
> BUT I am happy to see examples of the use of Agenda as well so if you can<br>> provide one that would be great.<br>><br>> Thanks again,<br>><br>> Roger<br>><br>><br>> On 7/25/08, Vanina Beraudo <<a href="mailto:vaninaberaudo@gmail.com">vaninaberaudo@gmail.com</a>> wrote:<br>
>><br>>> You are right I donīt use rule flow editor, Do you need work with rule<br>>> flow editor?<br>>><br>>> 2008/7/25 Roger Tanuatmadja <<a href="mailto:rogerst@gmail.com">rogerst@gmail.com</a>>:<br>
>> > Hi,<br>>> ><br>>> > Thanks for answering, but that kinda defeats the idea of rule flows<br>>> > doesn't<br>>> > it? I am assuming with Agenda you don't get to use the rule flow editor?<br>
>> ><br>>> > Thanks, and an example would be awesome!!<br>>> ><br>>> > Roger<br>>> ><br>>> ><br>>> > On 7/25/08, Vanina Beraudo <<a href="mailto:vaninaberaudo@gmail.com">vaninaberaudo@gmail.com</a>> wrote:<br>
>> >><br>>> >> Hi, Itīs possible using Agenda.<br>>> >><br>>> >> please look<br>>> >><br>>> >> <a href="http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e1111">http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e1111</a><br>
>> >><br>>> >> if you want I can give you an example.<br>>> >><br>>> >><br>>> >><br>>> >> 2008/7/25 Roger Tanuatmadja <<a href="mailto:rogerst@gmail.com">rogerst@gmail.com</a>>:<br>
>> >> > Hi,<br>>> >> ><br>>> >> > I've looked at the documentation, and I've tried doing it in the IDE,<br>>> >> > and<br>>> >> > basically I don't think it's possible.<br>
>> >> > Let's just say I have rule A and I want to reuse it as part of 2<br>>> >> > different<br>>> >> > rule flows. Is this possible? My guess is no.<br>>> >> ><br>
>> >> > Thanks,<br>>> >> ><br>>> >> > Roger<br>>> >> ><br>>> >> > _______________________________________________<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>> >> ><br>>> >> ><br>>> >><br>>> >><br>>> >><br>>> >> --<br>>> >> Lic. Vanina Beraudo<br>>> >><br>>> >> _______________________________________________<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>> ><br>>> ><br>>> > _______________________________________________<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>>> ><br>>> ><br>>><br>>><br>>><br>>> --<br>
>> Lic. Vanina Beraudo<br>>><br>>> _______________________________________________<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>><br>><br>> _______________________________________________<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>><br>
><br><br><br><br>--<br>Lic. Vanina Beraudo<br><br>_______________________________________________<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>