[rules-users] Weighted rules / scoring

Chris Strachan chris.strac at googlemail.com
Sun Jun 7 14:11:06 EDT 2009


Hi,

I want to be able to use drools / guvnor brms to store weighted rules
(scoring), however I can't seem to find a way to do this.

I attempted the following,

rule "Myscoreincreaserule"
       dialect "mvel"
       when
               Applicant( name == "chris" )
       then
               Applicant fact0 = new Applicant();
               fact0.setScore( score + 2 );
               insert(fact0 );
end

drools didn't seem to like the way I did this.  Perhaps this isn't
permitted, in effect I am trying to do - score = score + 2.

Upon validation I get the following error.

       [Myscoreincreaserule] Unable to build expression for 'consequence':
Failed
to compile: 1 compilation error(s): - (1,3) unqualified type in strict mode
for: age ' Applicant fact0 = new Applicant(); fact0.setScore( score + 2 );
insert(fact0 ); '

Any ideas on how I should be approaching this?

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090607/0b793776/attachment.html 


More information about the rules-users mailing list