[rules-users] How to retract events that don't match any rules (without @expires())

Ladd ladd at codemettle.com
Wed Jul 18 15:01:13 EDT 2012


Is there a recommended way to remove events from working memory that don't
match and can't activate any rules?

For example, let's say I have two rules which should both fire when a person
with name "Bob" is encountered.  If a person with name "Jim" comes in he
stays in working memory forever even though he doesn't match any current
rules.

I know @expires() for Person events would work.  But I don't know what a
"safe" time would be since I don't know ahead of time what temporal rules
might be written for them.

>From the 5.4.0 Drools Fusion docs (Chapter 2) I found these statements:

/"In other words, one an event is inserted into the working memory, it is
possible for the engine to find out when an event can no longer match other
facts and automatically retract it, releasing its associated resources."/

/"Events may be automatically expired after some time in the working memory.
Typically this happens when, based on the existing rules in the knowledge
base, the event can no longer match and activate any rules. Although, it is
possible to explicitly define when an event should expire."/

Based on this statement I would expect my "Jim" to be automatically expired
after "some time".  Maybe it will be and I'm just not waiting long enough.

But then I found this quote from Edson:

/"Any object type for which there are no explicit
expiration policy, nor temporal constraints from which to derive the
expiration offset will have an infinite expiration offset, i.e., will never
be automatically retracted."/

So my question is, how can I retract events which don't match any rules?

Thanks in advance for any tips or suggestsions!!

- Ladd

--
View this message in context: http://drools.46999.n3.nabble.com/How-to-retract-events-that-don-t-match-any-rules-without-expires-tp4018760.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list