<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">this is a one of my rules...<br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><span style="font-weight: bold;">rule "cancel_menu"</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; when</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; arrayList : ArrayList()</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE) and</span><br style="font-weight: bold;"><span
 style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; then</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; arrayList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL, Constants.SERVICE_ASSURANCE_MENU_CANCEL});</span><br style="font-weight: bold;"><span style="font-weight: bold;">end<br><br></span>i do an assert of an empty <span style="font-weight: bold;">arrayList</span>...<br>when i use this&nbsp;<span style="font-weight: bold;"> arrayList : ArrayList()</span> on the <span style="font-weight: bold;">when</span> the rule fire an error...why?<br>will the ArrayList be the same on all the rules (i think it will but want to make sure)<br><div>&nbsp;</div>Joel G.
 Rivera-Gonzalez<br>PRT<br><br>"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Kumaran S &lt;kumaran.shanmuhan@gmail.com&gt;<br>To: Joel G. Rivera-González &lt;el_pio@yahoo.com&gt;<br>Sent: Friday, January 5, 2007 5:42:01 PM<br>Subject: Re: [rules-users] rules questions...<br><br><span style="font-style: italic;">getResourceAsStream(ruleDrl) </span>expects to find a drl file based on the location represented by "<span style="font-style: italic;">ruleDrl"<span style="font-style: italic;">.
</span> </span>It should be noted that the location should be accessible from the CLASSPATH.&nbsp; You could get a null pointer exception, if the location is not accessible from your CLASSPATH.<br><br><div><span class="gmail_quote">
On 1/5/07, <b class="gmail_sendername">Joel G. Rivera-González</b> &lt;<a rel="nofollow" target="_blank" href="mailto:el_pio@yahoo.com">el_pio@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><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Trying to figure out the new rule system...<br>but it doesnt work...<span style="font-weight: bold;"><br><br>This is my rule:</span><br>
<br>package com.prtc.struts.rules<br>&nbsp;<br>import com.prtc.db.MegaTransferObject<br>import java.util.ArrayList<br>import com.prtc.struts.Constants<br>&nbsp;<br><span style="font-style: italic;">rule "cancel_menu"</span>
<br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; when</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; megaTO : MegaexistMegaTransferObject()</span><br style="font-style: italic;">
<span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; megaTO(other_EffectiveOrderTypeDsl != null) and&nbsp;&nbsp; </span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; megaTO(other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE
) and</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; megaTO(orders_FkOrderStatusId != null) and&nbsp;&nbsp; </span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; megaTO(orders_FkOrderStatusId == 
Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; then</span><br style="font-style: italic;">
<span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Hello");</span><br style="font-style: italic;"><span style="font-style: italic;">end</span><br><br><span style="font-weight: bold;">part of my
 code:<br></span><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; InputStreamReader ir = new InputStreamReader(RuleBuilderMgr.class.getClassLoader().getResourceAsStream(ruleDrl));&nbsp; //the null pointer is from this line.&nbsp; &nbsp;&nbsp;  </span>
<br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; builder.addPackageFromDrl(ir);</span><span style="font-weight: bold;"><br></span><br><span style="font-weight: bold;">this is the result:</span><br>
<span style="font-style: italic;">7661 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler&nbsp; - compiling com.prtc.struts.rules.Rule_cancel_menu_0</span><br style="font-style: italic;"><span style="font-style: italic;">
7942 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler&nbsp; - compile com.prtc.struts.rules.Rule_cancel_menu_0</span><br style="font-style: italic;"><span style="font-style: italic;">8062 [main] DEBUG
 org.apache.commons.jci.compilers.JaninoJavaCompiler&nbsp; - compiled com.prtc.struts.rules.Rule_cancel_menu_0</span><br style="font-style: italic;"><span style="font-style: italic;">8062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler
&nbsp; - compiling com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker</span><br style="font-style: italic;"><span style="font-style: italic;">8072 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler&nbsp; - compile 
com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker</span><br style="font-style: italic;"><span style="font-style: italic;">8092 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler&nbsp; - compiled com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu&nbsp; - Exception in
 ShowIspServiceAssuranceAction.execute --&gt; java.lang.NullPointerException</span><br style="font-style: italic;"><span style="font-style: italic;">8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
&nbsp; - java.lang.NullPointerException</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; at com.prtc.struts.util.ConstructServiceAssuranceTreeMenu.construct(ConstructServiceAssuranceTreeMenu.java:74)
</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; at com.prtc.lc.rules.managers.RuleTester.test1(RuleTester.java:299)</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; at 
com.prtc.lc.rules.managers.RuleTester.main(RuleTester.java:54)</span><br><br><br><br><br><br><br><div>&nbsp;</div>Joel G. Rivera-Gonzalez<br>PRT<br><br>"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's
 Law</div></div>
<br>_______________________________________________<br>rules-users mailing list<br><a rel="nofollow" target="_blank" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Give me a lever long enough... Single-handed, I shall move the world!
</div><br></div></div></div><br></div></div></body></html>