Re: [rules-users] drools arithmetics without eval()

2012-03-14 Thread fx242
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

Re: [rules-users] drools arithmetics without eval()

2012-03-14 Thread Vincent LEGENDRE
instead of accumulates. - a second set of rules checking counters to take a decision. - Mail original - De: fx242 dro...@fx242.com À: rules-users@lists.jboss.org Envoyé: Mercredi 14 Mars 2012 11:49:19 Objet: Re: [rules-users] drools arithmetics without eval() Hi, These rules are all

Re: [rules-users] drools arithmetics without eval()

2012-03-14 Thread Wolfgang Laun
accumulate is not the way to go. If you need accumlated counts for certain facts, by type or, within some type, by attribute value, then you should set up secondary facts and maintain these during the element insertion process or by separate (static) rules. class ProductCounter { String id;

Re: [rules-users] drools arithmetics without eval()

2012-03-14 Thread rouvas
Wolfgang Laun wrote: accumulate is not the way to go. If you need accumlated counts for certain facts, by type or, within some type, by attribute value, then you should set up secondary facts and maintain these during the element insertion process or by separate (static) rules. class

Re: [rules-users] drools arithmetics without eval()

2012-03-14 Thread Wolfgang Laun
Oh yes, indeed. -W On 14/03/2012, rou...@mm.di.uoa.gr rou...@mm.di.uoa.gr wrote: Wolfgang Laun wrote: accumulate is not the way to go. If you need accumlated counts for certain facts, by type or, within some type, by attribute value, then you should set up secondary facts and maintain these

Re: [rules-users] drools arithmetics without eval()

2012-03-14 Thread Vincent LEGENDRE
, I exec another rule (in a separate ruleflow-group or agenda-group) that updates the counters. Then I give the focus to decision rules ... - Mail original - De: rou...@mm.di.uoa.gr À: rules-users@lists.jboss.org Envoyé: Mercredi 14 Mars 2012 13:25:51 Objet: Re: [rules-users] drools

Re: [rules-users] drools arithmetics without eval()

2012-03-13 Thread Wolfgang Laun
You can rewrite this rule like this (if I managed to juggle the inequality correctly): client: Client() contextProd: PortfolioProduct(prodAdded == true, productId ==PROFESSIONAL) Number(qty_1: intValue* == 1* ) from accumulate(pp: PortfolioProduct(productId in (BOX_001), prodAdded ==