[rules-users] Event insert to session with 'not( after this..)'

RichardAmbridge richard.ambridge at gmail.com
Tue Feb 19 10:22:07 EST 2013


If I declare an event like:

declare Signature
 @role ( event )
 @timestamp(timestamp)
end

where timestamp is a long value set to the System.currentTimestamp()


and if I have a rule that has in it
$s : Signature(name=="YYYY")
not(Signature(name=="XXX", this after [0s,50h] $s))


If i insert a Signature that has name=YYYY, then after 50 hours this rule
will fire.. which is great.

However, we have a situation where sometimes we need to reload all our
rules.
Today, I grab all the Objects from the session  
engine.getKsession().getObjects()
and store them in a file (serialize), then recreate the session and reinsert
all the objects again.

However, this resets the time window for the event...
So if i insert Signature with name=YYYY,  wait 48 hours, reload the session
then the rule will not fire for another 50 hours, instead of in 2 hours
time.

The value of @timestamp is still set to the original time (48 hours ago) and
if I check
EventFactHandle handle=(EventFactHandle) ksession.insert(s);
handle.getStartTimestamp();
the value of StartTimestamp is set to 48 hours ago..

Is there anyway I can get the rule to fire at the correct time?

Many thanks
Ric

Running Drools 5.3.0



--
View this message in context: http://drools.46999.n3.nabble.com/Event-insert-to-session-with-not-after-this-tp4022455.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list