I'm trying to write a rule that delays firing until, at least, 15 minutes have passed since the last firing. However, the temporal operators in Drools Fusion only allow reasoning about two events in relation to each other and not one event in relation to the current time.
I would like something like this:
rule "some rule"
when
not LastFiredEvent(this before[0m, 15m] NOW)
…
I have resorted to writing a rule that fires every second and inserts a heartbeat event (also retracting the previous heartbeat), which I can use in other rules to serve as the current time.
I find this rather inelegant; am I missing something or does Drools Fusion really not have something for this?
NB. I am not looking for delayed firing of rules or rules that can only fire on multiples of 15 minutes; if nothing has happened in the last 17 minutes, the rule must fire immediately in response to a new event.