[rules-users] Strange behaviour when adding rules during run-time

IK81 ml at kofler.me
Wed Jun 26 05:10:03 EDT 2013


Dear all,

I am encountering a strange issue that rules fire based on events, which I
already considered as expired. As far as I learned from the documentation
Drools automatically determines the expiration time of an event based on
analyzing the rules (e.g. if there's a temporal operator or aggregation
using the event). Ok, i do not use anything of that. My scenario is as
follows - for testing purposes I use a pseudo session clock and of course
the STREAM mode.

- At time 0 I insert an Event A and call fireAllRules
- Then I advance the time for 100 seconds
- Now I add a further rule by parsing a drl file and adding it to the
Knowledge base of my current session
- Then, still at time 100 I insert another Event B and call fireAllRules
again

The rule that I've inserted previously fires but unfortunately twice. Once
for event A (which I already considered as expired) and for event B (which
is that what I wanted). 

Even if i use the @expires annotation in my drl this does not work
correctly. Do I have to call another method to trigger the expiration in the
session. Any suggestions?

Ingo

p.s. I am using Drools 5.5 final






--
View this message in context: http://drools.46999.n3.nabble.com/Strange-behaviour-when-adding-rules-during-run-time-tp4024561.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list