[rules-users] How to execute a rule only when a fact is retracted
Davide Sottara
dsotty at gmail.com
Wed Oct 17 14:41:33 EDT 2012
Yet another option to experiment with: use a listener to feed back trigger
facts in the WM
ksession.addEventListener( new WorkingMemoryEventListener() {
public void objectInserted(ObjectInsertedEvent event) {}
public void objectUpdated(ObjectUpdatedEvent event) {}
public void objectRetracted(ObjectRetractedEvent event) {
if( ... ) { ... ksession.insert() ... }
}
});
Actually, "closure callbacks" have already been discussed and will probably
be provided soon
Davide
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-execute-a-rule-only-when-a-fact-is-retracted-tp4020338p4020344.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
More information about the rules-users
mailing list