[rules-users] drools arithmetics without eval()

fx242 drools at fx242.com
Wed Mar 14 06:49:19 EDT 2012


Hi,

These rules are all auto-generated every day, and I don't control what is
going into them, so this kind of optimizations won't work for me. The basic
problem here, is that I have tons of rules that count facts
(PortfolioProducts) and use the result as rule conditions.
Some conditions could look like this: count(PortfolioProduct(A)) +
count(PortfolioProduct(B)) <= ( count(PortfolioProduct(C)) -
count(PortfolioProduct(D)) ) - count(PortfolioProduct(E))
and so on...

All rules look like the rule I've posted: I first calculate all relevant
fact counts to be used by the rule (accumulates), and then perform the
logic/arithmetic evaluation using evals(). Some rules end up having 15
accumulates and 2 evals as conditions...
My question is if using accumulate and eval() is the only choice I have to
write these kind of rules.

Regards,
Tiago Lopes

--
View this message in context: http://drools.46999.n3.nabble.com/drools-arithmetics-without-eval-tp3823232p3824958.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list