[rules-users] Delete a List of Facts

2013-05-25 Thread Weiss, Wolfgang
Hi, I want to delete a list of facts from the working memory and therefore created following rule: rule delete rule agenda-group evaluation salience 50 no-loop true when $facts : ArrayList(size 0) from collect (Fact()) then logger.info(delete rule, number of facts in list:

Re: [rules-users] Delete a List of Facts

2013-05-25 Thread Wolfgang Laun
In this rule, $facts is bound to a live ArrayList, i.e., a retract has an immediate effect on the collection. Iterate a copy for retracting all in a single firing. That said, it might be better to write a simple rule retracting each matching Fact individually. Collecting the list and retracting

Re: [rules-users] Delete a List of Facts

2013-05-25 Thread Weiss, Wolfgang
Betreff: Re: [rules-users] Delete a List of Facts In this rule, $facts is bound to a live ArrayList, i.e., a retract has an immediate effect on the collection. Iterate a copy for retracting all in a single firing. That said, it might be better to write a simple rule retracting each matching Fact