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"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></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 <<a href="mailto:martin.minka@gmail.com">martin.minka@gmail.com</a>> wrote:<br>
> I want to keep only 1 fact with id=="aaaa". But this is not working:<br>
><br>
> rule "leave only one"<br>
> when<br>
> $removeUs : java.util.List(size>1)<br>
> from collect(Fact(id=="aaaa")<br>
> then<br>
> size = $removeUs.size();<br>
> for (int i=1; i < size; i++) {<br>
> retract($removeUs.get(i));<br>
> }<br>
> end<br>
><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>