[rules-users] Rules that cumulate on consequence

2011-11-23 Thread lansyj
hi folks We are working on a requirement that requires us to have multiple rules that could fire for a given input and for all the rules that fire, we would want to cumulate the consequence to reach the final consequence. As an example, if we want to identify the credit score for a person,

Re: [rules-users] Rules that cumulate on consequence

2011-11-23 Thread Michael Anstis
Why not use a Fact that contains your result? In DRL terms it'd look like this:- rule one when $r : Result( $score : score ) Applicant( numberOfLoans 1 ) then $r.setScore( $score + 5 ); update( $r ); end rule two when $r : Result( $score :

Re: [rules-users] Rules that cumulate on consequence

2011-11-23 Thread lansyj
Thanks a billion mantis! We do think this would work; let me try it and confirm. -- View this message in context: http://drools.46999.n3.nabble.com/Rules-that-cumulate-on-consequence-tp3530214p3530252.html Sent from the Drools: User forum mailing list archive at Nabble.com.

Re: [rules-users] Rules that cumulate on consequence

2011-11-23 Thread Geoffrey De Smet
Good idea, but note that it will only work properly in a stateless session (which is most likely in his case). In a stateful session, with multiple fireAllRules and when the applicant's properties change between those fireAllRules call, the trick is to do an insertLogical of a ScoreDiff

Re: [rules-users] Rules that cumulate on consequence

2011-11-23 Thread Vincent Legendre
It will work properly in a stateless session ... in sequential mode ... may be. This rule for instance, will loop by itself (and all other will also loop), in a stateless or statefull session : rule one when $r : Result( $score : score ) Applicant( numberOfLoans 1 )

Re: [rules-users] Rules that cumulate on consequence

2011-11-23 Thread Michael Anstis
Yay, a great improvement :) 2011/11/23 Vincent Legendre vincent.legen...@eurodecision.com It will work properly in a stateless session ... in sequential mode ... may be. This rule for instance, will loop by itself (and all other will also loop), in a stateless or statefull session : rule