Thank you for the tip. What solution would you suggest to solve my problem ?<div><br></div><div>Martin</div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/11/30 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You cannot use an interfact (List) to instantiate an object, which<br>
is happening due to the collect.<br>
--W<br>
<div><div class="h5"><br>
On 30/11/2012, Martin Minka &lt;<a href="mailto:martin.minka@gmail.com">martin.minka@gmail.com</a>&gt; wrote:<br>
&gt; I want to keep only 1 fact with id==&quot;aaaa&quot;. But this is not working:<br>
&gt;<br>
&gt; rule &quot;leave only one&quot;<br>
&gt; when<br>
&gt;     $removeUs : java.util.List(size&gt;1)<br>
&gt;         from collect(Fact(id==&quot;aaaa&quot;)<br>
&gt; then<br>
&gt;     size = $removeUs.size();<br>
&gt;     for (int i=1; i &lt; size; i++) {<br>
&gt;         retract($removeUs.get(i));<br>
&gt;     }<br>
&gt; end<br>
&gt;<br>
</div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br></div>