The system I work on (sadly not drools based) at Southwest airlines is structured
similarly to this. (The interval events are mutable, however.) In my case the intervals
describe the activity of aircraft at airports. Events describing aircraft activity (leave
gate, take off, land, enter gate) populate the interval start and end times, and an
interval is considered active if the start time is populated but the end is still null.
Duration of the interval is managed by a heartbeat while it's active. (In drools maybe
this could be handled by the session clock, but I'm not sure. We do it by asserting a
control object based on a timer and having rules fire off that.)
This allows for a decent amount of flexibility: individual tracking of aircraft activity,
tracking of aggregate behavior, simple trend analysis of aggregate behavior, etc.
We're currently extending the system to use customer booking data to alert dispatchers
of flight connection problems and their severity, which leverages the existing aircraft
--- On Wed, 4/14/10, Barry Kaplan <groups1(a)memelet.com> wrote:
From: Barry Kaplan <groups1(a)memelet.com>
Subject: [rules-users] Fusion and open-ended intervals?
Date: Wednesday, April 14, 2010, 12:23 PM
A fusion design question:
I have events that represent intervals. Initially the
open-ended (kind a like the current state of an entity).
Other events are
matched "during" the interval and correlated. At some point
will be closed (eg, a specific downtime interval is closed
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
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
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
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
(eg, 3 downtimes longer than 2
minutes in the last hour).
View this message in context:
Sent from the Drools - User mailing list archive at
rules-users mailing list