<div>I want to keep only 1 fact with id=="aaaa". But this is not working:</div><div><br></div><div>rule "leave only one"</div><div>when</div><div> $removeUs : java.util.List(size>1)</div><div> from collect(Fact(id=="aaaa")</div>
<div>then</div><div> size = $removeUs.size();</div><div> for (int i=1; i < size; i++) {</div><div> retract($removeUs.get(i));</div><div> }</div><div>end</div>