One rules is fired per cycle, so it depends the rules that it&#39;s fired first.<br>You are right it&#39;s totally up to the conflict resolution strategy.<br><br><br><div class="gmail_quote">On Fri, Aug 6, 2010 at 12:04 PM, Anstis, Michael (M.) <span dir="ltr">&lt;<a href="mailto:manstis1@ford.com">manstis1@ford.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">






<div>


<p><font face="Arial" size="2">HI,</font>
</p>

<p><font face="Arial" size="2">There was an interesting discussion today on IRC; a user &quot;jochen&quot; reported NPEs when trying to iterate lists in the RHS constructed in the LHS using &quot;from collect&quot;.</font></p>


<p><font face="Arial" size="2">I was wondering how Drools handles lists constructed in the LHS; if the list contained 5 elements but another rule retracted one of those elements would the list available in the RHS contain 4 or 5 elements?</font></p>


<p><font face="Arial" size="2">Here&#39;s a simplification of what was posted at </font><a href="http://pastebin.com/yKGSxFkA" target="_blank"><u><font color="#0000ff" face="Arial" size="2">http://pastebin.com/yKGSxFkA</font></u></a>
</p>

<p><font face="Arial" size="2">Rule 1</font>

<br><font face="Arial" size="2">when</font>

<br>        <font face="Arial" size="2">$cheese : ArrayList() from collect(CheeseFact());</font>

<br><font face="Arial" size="2">then</font>

<br>        <font face="Arial" size="2">for(int i=0; i&lt;$cheese.size(); i++) {</font>

<br>                <font face="Arial" size="2">//Something useful…</font>

<br>        <font face="Arial" size="2">}</font>

<br><font face="Arial" size="2">end</font>
</p>

<p><font face="Arial" size="2">What if there was another rule that did something like this:-</font>
</p>

<p><font face="Arial" size="2">Rule 2</font>

<br><font face="Arial" size="2">When </font>

<br>        <font face="Arial" size="2">$cf : CheeseFact(type == &quot;chedder&quot;)</font>

<br><font face="Arial" size="2">Then</font>

<br>        <font face="Arial" size="2">retract($cf);</font>

<br><font face="Arial" size="2">end</font>
</p>

<p><font face="Arial" size="2">What would be the list Rule 1 iterates?</font>
</p>

<p><font face="Arial" size="2">I&#39;d assume since I believe activation execution to be serial it would depend on the agenda&#39;s conflict resolution strategy or rule salience?</font></p>

<p><font face="Arial" size="2">What would be the learned opinion?</font>
</p>

<p><font color="#000000" face="Arial" size="2">With kind regards,</font>
</p>

<p><font color="#000000" face="Arial" size="2">Mike</font>
</p>

</div>
<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com">http://www.plugtree.com</a>  <br> - MyJourney @ <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br>
 - Co-Founder @ <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -<br>