Hi Smitha, <br><br>Rewrite the rule as follows :- <br><br><div><font size="2">rule &quot;Rule1&quot;</font></div><font size="2">  </font><div><font size="2">when</font></div><font size="2">  </font><div><font size="2">$Position1 : Position ( name matches &quot;POS-RPT_0_1&quot; )
<br>then <br></font></div><div><font size="2">$Position.setColor(&quot;red&quot;);<br></font><font size="2"></font><div><font size="2">end</font></div><font size="2">  </font><br>Note : You had something called util, unless it is a global, it will not work. 
<br></div><br>-Krishnan. <br><br><div><span class="gmail_quote">On 6/18/07, <b class="gmail_sendername">Smitha Bhat</b> &lt;<a href="mailto:bhat_smitha@yahoo.com">bhat_smitha@yahoo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi,</div>  <div>I am new to JBoss rules. I have a .drl as given below:</div>  <div>&nbsp;</div><font size="2">  </font><div><font size="2">rule &quot;Rule1&quot;</font></div><font size="2">  </font><div><font size="2">when
</font></div><font size="2">  </font><div><font size="2">$Position1 : Position()</font></div><font size="2">  </font><div><font size="2">eval($Position1.getName() contains &quot;POS-RPT_0_1&quot;)</font></div><font size="2">
  </font><div><font size="2">then</font></div><font size="2">  </font><div></div><font size="2">  </font><div><font size="2">util.setColor($Position1, &quot;red&quot;);</font></div><font size="2">  </font><div><font size="2">
end</font></div><font size="2">  </font><div><font size="2">&nbsp;</font></div><font size="2">  </font><div><font size="2">Before firing the rules, I assert my object as </font></div><font size="2">  </font><div><font size="2">
&nbsp;</font></div><font size="2">  </font><div><font size="2">posIn = new Position(name,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;symbolCode,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lonDouble,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;latDouble,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;elevDouble,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reportDate,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this);<br>&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.assertObject
( posIn );<br>&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.fireAllRules(); </font></div><font size="2">  </font><div><font size="2">&nbsp;</font></div><font size="2">  </font><div><font size="2">I get the following error.</font></div><font size="2">  </font>
<div><font size="2">&nbsp;</font></div><font size="2"><font color="#ff0000" size="2">  <div>org.drools.rule.InvalidRulePackage: Rule Compilation error The left-hand side of an assignment must be a variable Syntax error on token &quot;contains&quot;, invalid AssignmentOperator
</div></font><font size="2"></font><font color="#ff0000" size="2">  </font></font><div><font size="2"><font color="#ff0000" size="2">at org.drools.rule.Package.checkValidity(Unknown Source)</font></font></div><font size="2">
<font color="#ff0000" size="2">  </font></font><div><font size="2"><font color="#ff0000" size="2">at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)</font></font></div><font size="2"><font color="#ff0000" size="2">
  </font></font><div><font size="2"><font color="#ff0000" size="2">&nbsp;</font></font></div><font size="2"><font color="#ff0000" size="2">  </font></font><div><font size="2"><font color="#ff0000" size="2">What is wrong with my drl? I have a Utilities class that I have defined as global.
</font></font></div><font size="2"><font color="#ff0000" size="2">  </font></font><div><font size="2"><font color="#ff0000" size="2">&nbsp;</font></font></div><font size="2"><font color="#ff0000" size="2">  </font></font><div>
<font size="2"><font color="#ff0000" size="2">Thanks</font></font></div><font size="2"><font color="#ff0000" size="2"><span class="ad">  <div>&nbsp;</div></span></font></font><span class="ad"><p> 
      </p><hr size="1">Looking for a deal? <a href="http://us.rd.yahoo.com/evt=47094/*http://farechase.yahoo.com/;_ylc=X3oDMTFicDJoNDllBF9TAzk3NDA3NTg5BHBvcwMxMwRzZWMDZ3JvdXBzBHNsawNlbWFpbC1uY20-" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Find great prices on flights and hotels</a> with Yahoo! FareChase.<p></p></span><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Sivaramakrishna Iyer Krishnan (Anand) <br><br>Never assume the obvious is true. <br>- William Safire