Thanks,<br><br>what do you suggest to clone the object in the first line of the consequence?<br><br>Regards<br>Raffo<br><br><br><br><div><span class="gmail_quote">2007/9/24, Mark Proctor <<a href="mailto:mproctor@codehaus.org">
mproctor@codehaus.org</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Have you thought of inserting your data, rather than setting it as a
global? It looks like statoNodo should be inserted and not a global.<br>
<br>
Also each rule will still use the same instance, if you need another
instance why not clone the object in the first line of the consequence?<br>
<br>
Mark<br>
Raffaele Viola wrote:
<blockquote type="cite"><div><span class="q" id="q_1153499ec41a4f5d_1">when a condition match call statoNodo.variabiliInOR(....)
that add in to the list the first arg<br>
<br>
the action function add the list in the azioe with the method
azione.setAzione("pio",lista);<br>
<br>
My list result is :
<br>
<span style="color: rgb(255, 0, 0);">Pisa</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">Cagliari</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">Pisa</span>
<br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">Cagliari</span><br>
<br>
p<span style="color: rgb(0, 0, 102);">ackage
org.drools.examples.decisiontable;</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">#generated from Decision Table</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">import
com.RuleEngine.ControlloreNodo.*;</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">import
com.RuleEngine.ControlloreNodo.OggettiControllo.Azione;</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">import
com.RuleEngine.ControlloreNodo.OggettiStato.StatoNodo;</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">import java.util.ArrayList;</span><br style="color: rgb(0, 0, 102);">
<br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">global StatoNodo statoNodo;</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">global Azione azione;</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">global ArrayList lista;</span><br style="color: rgb(0, 0, 102);">
<br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">#From row number: 13</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">rule "Pricing bracket_13"</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);"> </span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);"> salience 1</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);"> when</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">
eval(statoNodo.variabiliInOR("Pisa",lista,1))</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);"> then</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">
azione.setAzione("ciao",lista);</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">end</span><br style="color: rgb(0, 0, 102);">
<br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">#From row number: 14</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">rule "Pricing bracket_14"</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);"> </span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);"> salience 3</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);"> when</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">
eval(statoNodo.variabiliInOR("Cagliari,Pisa",lista,1))</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);"> then</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">
azione.setAzione("pio",lista);</span><br style="color: rgb(0, 0, 102);">
<span style="color: rgb(0, 0, 102);">end</span><br>
<br>
</span></div><pre><hr size="4" width="90%"><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>
<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>
</span></pre>
</blockquote>
<br>
</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></blockquote></div><br>