[rules-users] Fusion and open-ended intervals?

Barry Kaplan groups1 at memelet.com
Wed Apr 14 13:23:44 EDT 2010


A fusion design question:

I have events that represent intervals. Initially the intervals are
open-ended (kind a like the current state of an entity). Other events are
matched "during" the interval and correlated. At some point the interval
will be closed (eg, a specific downtime interval is closed because the
device is no online again). 

All the events in this system are immutable -- so if some property of an
event changes, it is cloned and modified in working-memory. For the case of
the interval events, initially the interval is inserted open-ended, and at
some point later closed and then modified. 

This does not work with fusion however, since an event's duration is
maintained by the fact-handle not the event itself. Hence a modify with a
now closed interval (ie, a finite @duration) has no effect. I'm guessing the
temporal values are maintained the handle to ensure stable values for the
behaviors that trigger based on temporal values, which is reasonable.

So I'm looking for alternative designs. Some are:
  1) Modeled the intervals as begin/end events, but that gets messy real
fast (have to correlate 
      the begin/end events somehow, can't use evaluators like 'includes' or
'during', etc). 
  2) Retract the interval event when it is closed (this way closed intervals
no longer correlate 
      with other incoming events). But then we really have a manually
maintained state machine
      using only facts, and there can be no reasoning over a series these
interval events.
     (eg, 3 downtimes longer than 2 minutes in the last hour).

Opinions?

-barry

-- 
View this message in context: http://n3.nabble.com/Fusion-and-open-ended-intervals-tp719076p719076.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list