[rules-users] Drools Rule Engine - Tiered Rates

ramram ramram858 at gmail.com
Wed Jun 30 06:54:24 EDT 2010


Hi Greg,

  Thnx 4 the mail that u have sent. It was really helpful in how can we
implement a Tiered rate concept using Drools Rule Engine. I have a question
concerning the mail that u sent and i would like to ask u if it can be
implemented:

{
	Object rate = rateType.newInstance();
	rateType.set( rate, "minUnits", 0 );
        rateType.set( rate, "maxUnits", 1000 );
	rateType.set( rate, "revenuePercent", 10 );
	ksession.insert(rate);
}
{
	Object rate = rateType.newInstance();
	rateType.set( rate, "minUnits", 1001 );
	rateType.set( rate, "maxUnits", 2000 );
	rateType.set( rate, "revenuePercent", 20 );
	ksession.insert(rate);
}
		
{
	Object sale = saleType.newInstance();
	saleType.set( sale, "units", 1500 );
	ksession.insert(sale);
}

   In this case 1500 will have a percentage of 20% because the value is
between 1001 and 2000 but in fact the following must occur (1000 should have
10% and the remaining 500 should have 20%  ). Can we implement this is
Drools Rule Engine.


Regards,
Ram
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Rule-Engine-Tiered-Rates-tp882038p932913.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list