try<br><br>global java.util.ArrayList arrayList;<br><br>or <br><br>global java.util.List arrayList;<br><br><div><span class="gmail_quote">On 1/8/07, <b class="gmail_sendername">Joel G. Rivera-González</b> &lt;<a 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;">
setting an <span style="font-weight: bold;">ArrayList</span> on a global value like this <span style="font-weight: bold;">workingMemory.setGlobal(&quot;arrayList&quot;, menuArray);</span> on the java code and like this on the rule 
<span style="font-weight: bold;">global ArrayList arrayList;<br><span style="font-weight: bold;"><br></span></span>cause the following error: <span style="font-weight: bold;"><span style="font-weight: bold;"><br></span></span>
23304 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu&nbsp; - Exception in ShowIspServiceAssuranceAction.execute --&gt; org.drools.rule.InvalidRulePackage: Rule Compilation error Redefinition of formal parameter &quot;arrayList&quot; Exception:1 errors while compiling unit &quot;com/prtc/struts/rules/Rule_pos_baja_feature_menu_0.java&quot;
<span class="q"><br><div>&nbsp;<br><br><br></div>Joel
 G. Rivera-Gonzalez<br>PRT<br><br>&quot;The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time&quot; - Murphy&#39;s Law</span><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;"><span class="q">----- Original Message ----<br>From: Steven Williams &lt;<a href="mailto:stevenw@objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
stevenw@objectconsulting.com.au</a>&gt;<br>To: Joel G. Rivera-González &lt;<a href="mailto:el_pio@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">el_pio@yahoo.com</a>&gt;<br></span><div><span class="e" id="q_10ffefae346127e8_4">
Cc: drools &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a>&gt;<br>Sent: Sunday, January 7, 2007 6:00:41 PM<br>Subject: Re: Fw: [rules-users] rules questions...
<br><br>Hi Joel,<br><br>The whole point of globals is that you don&#39;t need to assert them you just set them from the calling code, ie:<br><br>workingMemory.setGlobal(&quot;myList&quot;, arrayList);<br><br>You can then use myList in your consequence.
<br><br>There is no way to use an asserted object in a consequence without binding it to a variable in one of the conditions.<br><br>cheers<br>Steve<br><br><br><div><span class="gmail_quote">On 1/8/07, <b class="gmail_sendername">

Joel G. Rivera-González</b> &lt;<a rel="nofollow" href="mailto:el_pio@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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;">ok..after playing a while with this global thing...i found out that global variables cant be asserted...<br><br>any other idea of how to use an asserted arrayList on the consequence without writing it on the conditions?
<span><br><div>&nbsp;</div>Joel G. Rivera-Gonzalez<br>PRT<br><br>&quot;The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time&quot; - Murphy&#39;s Law</span><div><span>
<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: Joel G. Rivera-González &lt;
<a rel="nofollow" href="mailto:el_pio@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">el_pio@yahoo.com</a>&gt;<br>To: drools &lt;<a rel="nofollow" href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

rules-users@lists.jboss.org</a>&gt;<br>Sent: Sunday, January 7, 2007 10:48:50 AM<br>Subject: Re: Fw: [rules-users] rules questions...<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">

thanks for your input...this is exactly what i was looking for !<br><br>:)<br><div>&nbsp;</div>Joel G. Rivera-Gonzalez<br>PRT<br><br>&quot;The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time&quot; - Murphy&#39;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: Steven Williams &lt;
<a rel="nofollow" href="mailto:stevenw@objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">stevenw@objectconsulting.com.au</a>&gt;<br>To: Joel G. Rivera-González &lt;<a rel="nofollow" href="mailto:el_pio@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

el_pio@yahoo.com</a>&gt;<br>Cc: <a rel="nofollow" href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br>Sent: Sunday, January 7, 2007 3:53:34 AM
<br>Subject: Re: Fw: [rules-users] rules questions...<br><br>Hi Joel,<br><br>I think you should rather use a global for the ArrayList:<br><br>global java.util.List myList<br><br>rule
 &quot;cancel_menu&quot;<br>&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl == 
Constants.NEW_OPEN_ORDER_TYPE)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)&nbsp;&nbsp;  <br>&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myList.add(new String[]{
Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});&nbsp;&nbsp;  <br>end<br><br>btw - you don&#39;t need to put &quot;and&quot; at the end of each constraint.<br><br>cheers<br>Steve<br><br><div><span class="gmail_quote">On 1/7/07, <b class="gmail_sendername">


Joel G. Rivera-González</b> &lt;<a rel="nofollow" href="mailto:el_pio@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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;"><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 &quot;cancel_menu&quot;</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)
<span><br><div>&nbsp;</div>Joel G.
 Rivera-Gonzalez<br>PRT<br><br>&quot;The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time&quot; - Murphy&#39;s Law</span><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;<a rel="nofollow" href="mailto:kumaran.shanmuhan@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">


kumaran.shanmuhan@gmail.com</a>&gt;<br>To: Joel G. Rivera-González &lt;<a rel="nofollow" href="mailto:el_pio@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">el_pio@yahoo.com</a>&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 &quot;<span style="font-style: italic;">


ruleDrl&quot;<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><div><span>
<span class="gmail_quote">
On 1/5/07, <b class="gmail_sendername">Joel G. Rivera-González</b> &lt;<a rel="nofollow" href="mailto:el_pio@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">el_pio@yahoo.com</a>&gt; wrote:
</span></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span>
<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 &quot;cancel_menu&quot;</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(&quot;Hello&quot;);</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>&quot;The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time&quot; - Murphy&#39;s
 Law</div></div></span></div>
<br>_______________________________________________<br>rules-users mailing list<br><a rel="nofollow" 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 rel="nofollow" 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><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></div>
<br>_______________________________________________<br>rules-users mailing list<br><a rel="nofollow" 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 rel="nofollow" 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><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
<br><a rel="nofollow" href="mailto:stevenw@objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">stevenw@objectconsulting.com.au</a><br><a rel="nofollow" href="http://www.objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

www.objectconsulting.com.au</a><br><br>consulting | development | training | support
<br>our experience makes the difference
</div><br></div></div><div>_______________________________________________<br>rules-users mailing list<br><a rel="nofollow" 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 rel="nofollow" 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></div></div><br></div></span></div></div></div>
<br>_______________________________________________<br>rules-users mailing list<br><a rel="nofollow" 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 rel="nofollow" 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><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
<br><a rel="nofollow" href="mailto:stevenw@objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">stevenw@objectconsulting.com.au</a><br><a rel="nofollow" href="http://www.objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
www.objectconsulting.com.au</a><br><br>consulting | development | training | support
<br>our experience makes the difference
</span></div></div><br></div></div></div>
<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><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
<br><a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br><a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br><br>consulting | development | training | support
<br>our experience makes the difference