[rules-users] drools-camel-server > RetractAll() Command?

Vincent LEGENDRE vincent.legendre at eurodecision.com
Wed Jun 27 18:45:05 EDT 2012


... and don't forget the 'Cleanup trigger' cleanup rule too ...
You can also do that kind of rule without 'Cleanup trigger', using a very low salience, or specific agenda-group or ruleflow-group. 

But if you really retract ALL facts, it will be far much faster to create a new kSession (not a new KB, but a new session of the same KB, terms are important here). Remember that retracting facts will trigger RETE evaluation (and beware if you have logical insertions too). And last (but not least), at end of rules execution, I think you are expecting to get the newly created objects ...  but they won't be there anymore.

To me, massive retracts inside rules are only relevant if you want to keep some knowledge in the current kSession. And even in this case, I really find cleaner to insert-at-init / retract-at-end in the same place (both java or both rules).



More information about the rules-users mailing list