You can set up a periodic timer to update a Tick( currentTime ) and use this Tick fact in your rule:<br><br>rule "Set Tick"<br> timer(int:0s 1s)<br>when<br> $tick : Tick()<br>then<br> modify( $tick ){ setCurrentTime( ... ) }<br>
end<br><br>rule "tst"<br>when<br>
$ongoing: IntervalEvent( id == "foo", $s: msecstart, $d : msecdur ) )<br> Tick( currentTime >= $s && <= ($s+$d) )<br>then<br>...<br>end<br><br><div class="gmail_quote">On 28 October 2010 16:22, Jaroslav Pullmann <span dir="ltr"><<a href="mailto:jaroslav.pullmann@fit.fraunhofer.de">jaroslav.pullmann@fit.fraunhofer.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Dear all,<br>
<br>
I am wondering whether and how the rule activation might be contextualized<br>
in respect to the existence of a time slot signalled via interval events (with a<br>
non-null duration). The static rule attributes (date-effective, date-expires) are<br>
not applicable here, neither is the temporal operator "during", which requires<br>
the existence of an explicit second event. The following approach demonstrates the<br>
case but does not work (return value restrictions are not allowed to invoke time-<br>
dependent functions):<br>
<br>
rule "active time slot"<br>
when<br>
// partial condition met when there is a "live"/ongoing IntervalEvent "foo"<br>
$system : System()<br>
$ongoing: IntervalEvent( id == "foo", $system.currentTimeMillis <= ( msecstart + msecdur ) )<br>
... further patterns<br>
then<br>
...<br>
end<br>
<br>
Many thanks for your suggestions!<br>
Jaro<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>