I think your issue is resolved Chris, but just curious would putting the rule like below make it more efficient?<br><br>rule &quot;Myscoreincreaserule&quot;<br>
   dialect &quot;mvel&quot;<br>
   when<br>
       a : Applicant( name == &quot;chris&quot;,$score:score )<br>
   then<br>
       a.setScore( $score + 2 );<br>
end<br><br clear="all">--Sarish<br><br>&quot;Shoot for the moon. Even if you miss it you will land among the stars.&quot; - Les Brown 
<br><br><div class="gmail_quote">On Mon, Jun 8, 2009 at 11:06 AM, Chris Strachan <span dir="ltr">&lt;<a href="mailto:chris.strac@googlemail.com">chris.strac@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
Hi,<br>
<br>
Don&#39;t think I intended to create a new instance, just modify the one matched in the rule.  The following seems to have got it working.<div class="im"><br>
<br>
rule &quot;Myscoreincreaserule&quot;<br>
   dialect &quot;mvel&quot;<br>
   when<br></div>
       a : Applicant( name == &quot;chris&quot; )<br>
   then<br>
       a.setScore( a.score + 2 );<br>
end<br>
<br>
Thanks for pointing me in the right direction.<div><div></div><div class="h5"><br>
<br>
Greg Barton wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
1) Where is the variable &quot;score&quot; initialized? If it&#39;s not a global the rule wouldn&#39;t compile.<br>
<br>
2) Is your intent to create a new Applicant instance, or modify the one matched in the rule?  (Or maybe you want to gather the score from the matched instance and put it (+2) into a new instance?<br>
<br>
--- On Sun, 6/7/09, Chris Strachan &lt;<a href="mailto:chris.strac@googlemail.com" target="_blank">chris.strac@googlemail.com</a>&gt; wrote:<br>
<br>
  <br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
From: Chris Strachan &lt;<a href="mailto:chris.strac@googlemail.com" target="_blank">chris.strac@googlemail.com</a>&gt;<br>
Subject: [rules-users] Weighted rules / scoring<br>
To: <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
Date: Sunday, June 7, 2009, 1:11 PM<br>
Hi,<br>
<br>
<br>
<br>
I want to be able to use drools / guvnor brms to store<br>
weighted rules<br>
<br>
(scoring), however I can&#39;t seem to find a way to do<br>
this.<br>
<br>
<br>
<br>
I attempted the following,<br>
<br>
<br>
<br>
rule &quot;Myscoreincreaserule&quot;<br>
<br>
        dialect &quot;mvel&quot;<br>
<br>
        when<br>
<br>
                Applicant( name ==<br>
&quot;chris&quot; )<br>
<br>
        then<br>
<br>
                Applicant fact0 = new Applicant();<br>
<br>
                fact0.setScore( score + 2 );<br>
<br>
                insert(fact0 );<br>
<br>
end<br>
<br>
<br>
<br>
drools didn&#39;t seem to like the way I did this.<br>
 Perhaps this isn&#39;t<br>
<br>
permitted, in effect I am trying to do - score = score +<br>
2.<br>
<br>
<br>
<br>
Upon validation I get the following error.<br>
<br>
<br>
<br>
        [Myscoreincreaserule] Unable to build<br>
expression for &#39;consequence&#39;: Failed<br>
<br>
to compile: 1 compilation error(s): - (1,3) unqualified<br>
type in strict mode<br>
<br>
for: age &#39; Applicant fact0 = new Applicant();<br>
fact0.setScore( score + 2 );<br>
<br>
insert(fact0 ); &#39;<br>
<br>
<br>
<br>
Any ideas on how I should be approaching this?<br>
<br>
<br>
<br>
Thanks,<br>
<br>
<br>
-----Inline Attachment Follows-----<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
    <br>
</blockquote>
<br>
<br>
      <br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
  <br>
</blockquote>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>