You can also try a data driven approach:

declare Rate
    minUnits : int
    maxUnits : int
    revenuePercent : int
end

declare Sale
    units : int
end

rule "FindRate"
    when
        r : Rate( )
        s : Sale( units > r.minUnits, units < r.maxUnits )
    then
        System.out.println( "revenuePercent for " + s + " is " + r.getRevenuePercent());
end

Sample code attached.

--- On Wed, 6/9/10, Esteban Aliverti <esteban.aliverti@gmail.com> wrote:

From: Esteban Aliverti <esteban.aliverti@gmail.com>
Subject: Re: [rules-users] Drools Rule Engine - Tiered Rates
To: "Rules Users List" <rules-users@lists.jboss.org>
Date: Wednesday, June 9, 2010, 7:45 AM

Did you take a look at drools-template?

Best,

On Wed, Jun 9, 2010 at 9:24 AM, ramram <ramram858@gmail.com> wrote:

Hi All,

  I have the following question regarding Drools. The possibility to
implement tiered rates and that is I have the following example.
  If the total units sold is between 0 - 1000 item a revenue return is 10%
while if the total units sold is between 1001- 2000 items the return is 20%.

  I want to use 1 dynamic rule to implement the above example rather than
having 2 static rules defined? is this possible through drools?


Regards
Ram
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Rule-Engine-Tiered-Rates-tp882038p882038.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti

-----Inline Attachment Follows-----

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users