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

Barry Kaplan groups1 at memelet.com
Thu Apr 15 20:19:28 EDT 2010


Actually Greg I did something very similar. Since drools locks down the event
temporal values, I added to my event class some helper methods indicating
whether the interval is open or closed:

abstract class Event {
  def interval: Interval  // joda interval
  def isOpen = interval.end.getMillis == infiniteMillis
  def isClosed = !isOpen
}

And then in rules, when to consider only open intervals I do something like

when
  device: Device()
  executionState: ExecutionStateEvent(deviceId == device.id, name ==
"STOPPED") from entry-point "mtconnect"
  not (DowntimeInterval(deviceId == device.id, open == true, this includes
executionState) from entry-point "downtime")

This is not going to work for all situations, but its a pattern in the
toolbox.

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



More information about the rules-users mailing list