<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">You can also try a data driven approach:<br><br>declare Rate<br>&nbsp;&nbsp;&nbsp; minUnits : int<br>&nbsp;&nbsp;&nbsp; maxUnits : int <br>&nbsp;&nbsp;&nbsp; revenuePercent : int<br>end<br><br>declare Sale<br>&nbsp;&nbsp;&nbsp; units : int<br>end<br><br>rule "FindRate"<br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; r : Rate( ) <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; s : Sale( units &gt; r.minUnits, units &lt; r.maxUnits )<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println( "revenuePercent for " + s + " is " + r.getRevenuePercent());<br>end<br><br>Sample code attached.<br><br>--- On <b>Wed, 6/9/10, Esteban Aliverti <i>&lt;esteban.aliverti@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Esteban Aliverti
 &lt;esteban.aliverti@gmail.com&gt;<br>Subject: Re: [rules-users] Drools Rule Engine - Tiered Rates<br>To: "Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br>Date: Wednesday, June 9, 2010, 7:45 AM<br><br><div id="yiv1819455724">Did you take a look at drools-template?<div><a rel="nofollow" target="_blank" href="http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html_single/index.html#d4e3346">http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html_single/index.html#d4e3346</a></div>

<div><br></div><div><a rel="nofollow" target="_blank" href="http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html_single/index.html#d4e3346"></a>Best,<br><br><div class="gmail_quote">On Wed, Jun 9, 2010 at 9:24 AM, ramram <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:ramram858@gmail.com" target="_blank" href="/mc/compose?to=ramram858@gmail.com">ramram858@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Hi All,<br>
<br>
 &nbsp; I have the following question regarding Drools. The possibility to<br>
implement tiered rates and that is I have the following example.<br>
 &nbsp; If the total units sold is between 0 - 1000 item a revenue return is 10%<br>
while if the total units sold is between 1001- 2000 items the return is 20%.<br>
<br>
 &nbsp; I want to use 1 dynamic rule to implement the above example rather than<br>
having 2 static rules defined? is this possible through drools?<br>
<br>
<br>
Regards<br>
Ram<br>
<font color="#888888">--<br>
View this message in context: <a rel="nofollow" target="_blank" href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Rule-Engine-Tiered-Rates-tp882038p882038.html">http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Rule-Engine-Tiered-Rates-tp882038p882038.html</a><br>


Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
</div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=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></div></blockquote></td></tr></table><br>