<br>Hi Smitha, <br><br>They way I understand, in the then clause you would like to call a static function from some class. So, then you can add that to the import and access it directly. It does not have to be global. However, if for some reason you do need to add it as a global,, let me know. 
<br><br>send that when part of the rule again. <br><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 Krishnan,</div>  <div>I need the functionality of being able to call methods of a global class in the &#39;then&#39; piece of the drl. I had defined the drl file as:
</div>  <div>&nbsp;</div>  <div>package test.tools.rulesengine</div>  <div>import test.tools.rulesengine.Utilities;</div>  <div>global test.tools.rulesengine.Utilities util;</div>  <div>&nbsp;</div>  <div>rule &quot;Rule1&quot;.................
</div>  <div>&nbsp;</div>  <div>When I debug the &#39;when&#39; piece, I see that the method to check the name is being called, but tfter that, the global util&#39;s class method is not called. Any pointers would be helpful.</div>
  <div>&nbsp;</div>  <div>Thanks,</div>  <div>Smitha<div><span class="e" id="q_1133f559e249ad7d_1"><br><br><b><i>Krishnan &lt;<a href="mailto:krishiyer@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
krishiyer@gmail.com</a>&gt;</i></b> wrote:</span></div></div>  <blockquote style="border-left: 2px solid rgb(16, 16, 255); padding-left: 5px; margin-left: 5px;"><div><span class="e" id="q_1133f559e249ad7d_3">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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
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"></font>
&nbsp;</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"></font>&nbsp;</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"></font>&nbsp;</div><font size="2"></font>  <div><font size="2">I get the following error.</font></div><font size="2"></font>  <div><font size="2"></font>&nbsp;</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"></font></font>&nbsp;</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"></font></font>&nbsp;</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>  <div>&nbsp;</div></span></font></font><span>  <div></div>  <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.  <div></div></span><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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></span></div>- William Safire _______________________________________________
<span class="q"><br>rules-users mailing
 list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br></span></blockquote><span class="ad"><br><p> 
      </p><hr size="1">Need a vacation? <a href="http://us.rd.yahoo.com/evt=48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ--" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Get great deals 
to amazing places </a>on Yahoo! Travel. <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