You can create another event, in parallel to the TestEvent to be monitored, with
a timestamp derived from the external definition. The rule uses the TestEvent
and the sentinel event to check, with "after'" for the TestEvent and
"before"
with the sentinel.
-W
On 27 August 2010 11:03, Tobias Salzbrunn <tobias.salzbrunn(a)web.de> wrote:
Hi,
I want to fomulate in the LHS something like:
after an event happened another event of this kind did not happen for a
specified time (somewhere externally defined).
Unfortunatly, the obvious solution with the temporal operator 'after':
---------------------------------------------------------------------
rule "rule temporal 1" ruleflow-group "g1"
when
$event : TestEvent($id: id)
not( TestEvent(eval($id != id), this after[0ms,5000ms] $event ) )
then
System.out.println( "Alarm " + $event.getId());
end
---------------------------------------------------------------------
does not work here, because the specified time has to be hardcoded
(
http://drools-java-rules-engine.46999.n3.nabble.com/Using-variables-in-Te...
http://drools-java-rules-engine.46999.n3.nabble.com/Using-variables-in-Te...
)
Is there a way to work around this limitation in this special case?
I considered a polling approach with timers, but then I dont know how to
stop the timer after firing the rule.
Thanks in advance for your time.
Tobias
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/temporal-operator-wor...
Sent from the Drools - User mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users