[rules-users] enabling rules based on interval events

Jaroslav Pullmann jaroslav.pullmann at fit.fraunhofer.de
Thu Oct 28 10:22:47 EDT 2010


Dear all,

  I am wondering whether and how the rule activation might be contextualized
  in respect to the existence of a time slot signalled via interval events (with a
  non-null duration). The static rule attributes (date-effective, date-expires) are
  not applicable here, neither is the temporal operator "during", which requires
  the existence of an explicit second event. The following approach demonstrates the
  case but does not work (return value restrictions are not allowed to invoke time-
  dependent functions):

   rule "active time slot"
     when
       		// partial condition met when there is a "live"/ongoing IntervalEvent "foo"
           $system : System()
           $ongoing: IntervalEvent( id == "foo", $system.currentTimeMillis <= ( msecstart + msecdur ) )
	  ... further patterns
     then
           ...
     end

  Many thanks for your suggestions!
    Jaro



More information about the rules-users mailing list