I know that this timer inserts real-time. I plan to persists also the
timestamps when I call these external timer-based fireAllRules invocations.
The problem is that I have to support rules that reason over the
non-occurence of events and not every time I insert a new event. I don't
know how I could realize this otherwise. I'd love to have a kind of callback
where the engine tells me - wake me up in X seconds so that I can
re-evaluate my rules because then my not-after-N-timeunits rules can fire.
The reason for this approach is that I'll have to ensure that I process
every event but be tolerant against re-starts of my application server. If I
have a rule - let's say fire if I have event A but no event B after 3 minute
and I insert event A. Let's assume that the application server is rebooted
in the meantime and I start with a clean session, then this rule would never
fire. Unfortunately, I cannot afford to persist the complete state after
every rule insertion due to performance reasons. However, the events have to
be persisted anyway. Therefore, I came to this proposal to persist the state
only after N seconds or insertions as a kind of snapshot. In case of
recovery after a reboot (or transfer of the engine to another cluster node)
I use the snapshot, reinsert the events to get to the same state. However,
this was just my idea how to solve this problem. If you could provide me a
pointer to a better solution I'd also be very thankful.
Thanks for the hint about the timestamp. But isn't the clock of the session
also relevant when inserting new events (which have their own timestamp
provided in the event's POJO?). Therefore, I though that it is necessary to
store both the event's timestamp (which is assigned by an external event
source) and the timestamp when I put it into the engine.
Ingo
--
View this message in context:
http://drools.46999.n3.nabble.com/Snapshot-of-drools-engine-s-state-tp402...
Sent from the Drools: User forum mailing list archive at
Nabble.com.