<div>Mark,</div>  <div>I wasn't clear about that. I am instantiating the class and then making making that instance global in the working memory as shown below in the code snippet.</div>  <div>&nbsp;</div>  <DIV>try {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;builder.addPackageFromDrl(new StringReader( drl) );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(firstCall){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ruleBase = RuleBaseFactory.newRuleBase();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;ruleBase.addPackage( builder.getPackage() );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;workingMemory = ruleBase.newWorkingMemory();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Utilities util = new Utilities();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;workingMemory.setGlobal("util", util);</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;firstCall =
 false;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;}else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;ruleBase.addPackage( builder.getPackage() );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//workingMemory = ruleBase.newWorkingMemory();<BR>&nbsp;&nbsp;&nbsp;&nbsp;} catch (DroolsParserException e1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e1.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;} catch (IOException e1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e1.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;} catch (Exception e1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e1.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;}</DIV>  <div>&nbsp;</div>  <div>Smitha<BR><BR><B><I>Mark Proctor &lt;mproctor@codehaus.org&gt;</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT:
 5px; BORDER-LEFT: #1010ff 2px solid">class instances are globals, classes themselves aren't.<BR><BR>Mark<BR>Smitha Bhat wrote:   <BLOCKQUOTE cite=mid:704245.71238.qm@web60316.mail.yahoo.com type="cite">  <DIV>Hi Krishnan,</DIV>  <DIV>I need the class itself to be global as I might have to access other functions of it as I go along in the effort. </DIV>  <DIV>I cannot seem to be able to call the methods of this global class. I have also added a snippet of the code.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Thanks</DIV>  <DIV>&nbsp;Smitha</DIV>  <DIV>Here is my drl</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>drl=</DIV><FONT size=1></FONT>  <DIV><FONT size=1>package test.tools.rulesengine</FONT></DIV><FONT size=1></FONT>  <DIV><FONT size=1>import test.tools.rulesengine.Utilities;</FONT></DIV><FONT size=1></FONT>  <DIV><FONT size=1>global test.tools.rulesengine.Utilities util;</FONT></DIV><FONT size=1></FONT>  <DIV><FONT size=1>rule "Rule1"</FONT></DIV><FONT size=1></FONT> 
 <DIV><FONT size=1>when</FONT></DIV><FONT size=1></FONT>  <DIV><FONT size=1>$Position1 : PosReport()</FONT></DIV><FONT size=1></FONT>  <DIV><FONT size=1>eval($Position1.getName() == "POS_0_1")</FONT></DIV><FONT size=1></FONT>  <DIV><FONT size=1>then</FONT></DIV><FONT size=1></FONT><FONT size=1></FONT>  <DIV><FONT size=1>util.setColor($Position1, "red");</FONT></DIV><FONT size=1></FONT>  <DIV><FONT size=1>end</FONT></DIV><FONT size=1></FONT>  <DIV><FONT size=1></FONT>&nbsp;</DIV><FONT size=1></FONT>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>try {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;builder.addPackageFromDrl(new StringReader( drl) );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(firstCall){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ruleBase = RuleBaseFactory.newRuleBase();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;ruleBase.addPackage( builder.getPackage() );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;workingMemory =
 ruleBase.newWorkingMemory();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Utilities util = new Utilities();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;workingMemory.setGlobal("util", util);</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;firstCall = false;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;}else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;ruleBase.addPackage( builder.getPackage() );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//workingMemory = ruleBase.newWorkingMemory();<BR>&nbsp;&nbsp;&nbsp;&nbsp;} catch (DroolsParserException e1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e1.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;} catch (IOException e1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e1.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;} catch (Exception e1)
 {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e1.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;}</DIV>  <DIV><BR><BR><B><I>Krishnan <A class=moz-txt-link-rfc2396E href="mailto:krishiyer@gmail.com">&lt;krishiyer@gmail.com&gt;</A></I></B> wrote:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><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" moz-do-not-send="true">bhat_smitha@yahoo.com </A>&gt; wrote:</SPAN>  
 <BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">  <DIV>Hi Krishnan,</DIV>  <DIV>I need the functionality of being able to call methods of a global class in the 'then' 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 "Rule1"................. </DIV>  <DIV>&nbsp;</DIV>  <DIV>When I debug the 'when' piece, I see that the method to check the name is being called, but tfter that, the global util'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 onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:krishiyer@gmail.com" target=_blank
 moz-do-not-send="true"> krishiyer@gmail.com</A>&gt;</I></B> wrote:</SPAN></DIV></DIV>  <BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">  <DIV><SPAN class=e id=q_1133f559e249ad7d_3>Hi Smitha, <BR><BR>Rewrite the rule as follows :- <BR><BR>  <DIV><FONT size=2>rule "Rule1"</FONT></DIV>  <DIV><FONT size=2>when</FONT></DIV>  <DIV><FONT size=2>$Position1 : Position ( name matches "POS-RPT_0_1" ) <BR>then <BR></FONT></DIV>  <DIV><FONT size=2>$Position.setColor("red");<BR></FONT>  <DIV><FONT size=2>end</FONT></DIV><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 onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:bhat_smitha@yahoo.com" target=_blank moz-do-not-send="true"> bhat_smitha@yahoo.com</A>&gt; wrote:</SPAN>   <BLOCKQUOTE class=gmail_quote
 style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">  <DIV>Hi,</DIV>  <DIV>I am new to JBoss rules. I have a .drl as given below: </DIV>  <DIV>&nbsp;</DIV>  <DIV><FONT size=2>rule "Rule1"</FONT></DIV>  <DIV><FONT size=2>when </FONT></DIV>  <DIV><FONT size=2>$Position1 : Position()</FONT></DIV>  <DIV><FONT size=2>eval($Position1.getName() contains "POS-RPT_0_1")</FONT></DIV>  <DIV><FONT size=2>then</FONT></DIV>  <DIV><FONT size=2>util.setColor($Position1, "red");</FONT></DIV>  <DIV><FONT size=2>end</FONT></DIV>  <DIV>&nbsp;</DIV>  <DIV><FONT size=2>Before firing the rules, I assert my object as </FONT></DIV>  <DIV>&nbsp;</DIV>  <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>  <DIV>&nbsp;</DIV>  <DIV><FONT size=2>I get the following error.</FONT></DIV>  <DIV>&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 "contains", invalid AssignmentOperator </DIV></FONT></FONT>  <DIV><FONT size=2><FONT color=#ff0000 size=2>at org.drools.rule.Package.checkValidity(Unknown Source)</FONT></FONT></DIV>  <DIV><FONT size=2><FONT color=#ff0000 size=2>at
 org.drools.common.AbstractRuleBase.addPackage(Unknown Source)</FONT></FONT></DIV>  <DIV>&nbsp;</DIV>  <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>  <DIV>&nbsp;</DIV>  <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>  <HR SIZE=1>  Looking for a deal? <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/evt=47094/*http://farechase.yahoo.com/;_ylc=X3oDMTFicDJoNDllBF9TAzk3NDA3NTg5BHBvcwMxMwRzZWMDZ3JvdXBzBHNsawNlbWFpbC1uY20-" target=_blank moz-do-not-send="true">Find great prices on flights and hotels</A> with Yahoo! FareChase. </SPAN><BR>_______________________________________________<BR>rules-users mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target=_blank
 moz-do-not-send="true">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 moz-do-not-send="true">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 onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target=_blank moz-do-not-send="true">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 moz-do-not-send="true">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR></SPAN></BLOCKQUOTE><SPAN class=ad><BR>  <HR SIZE=1>  Need a
 vacation? <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/evt=48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ--" target=_blank moz-do-not-send="true">Get great deals to amazing places </A>on Yahoo! Travel. </SPAN><BR>_______________________________________________<BR>rules-users mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" moz-do-not-send="true">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 moz-do-not-send="true">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
 _______________________________________________<BR>rules-users mailing list<BR><A class=moz-txt-link-abbreviated href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A><BR><A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR></BLOCKQUOTE><BR>  <div></div>  <HR SIZE=1>  Get the Yahoo! toolbar and <A href="http://us.rd.yahoo.com/evt=48225/*http://new.toolbar.yahoo.com/toolbar/features/mail/index.php" moz-do-not-send="true">be alerted to new email </A>wherever you're surfing. <PRE wrap=""><HR width="90%" SIZE=4>  _______________________________________________  rules-users mailing list  <A class=moz-txt-link-abbreviated href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A>  <A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</A>   
 </PRE></BLOCKQUOTE><BR>_______________________________________________<BR>rules-users mailing list<BR>rules-users@lists.jboss.org<BR>https://lists.jboss.org/mailman/listinfo/rules-users<BR></BLOCKQUOTE><BR><p>&#32;
      <hr size=1>Be a better Globetrotter. <a href="http://us.rd.yahoo.com/evt=48254/*http://answers.yahoo.com/dir/_ylc=X3oDMTI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTklfMzYwBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545469">Get better travel answers </a>from someone who knows.<br>Yahoo! Answers - Check it out.