The negated existence is represented by a "not" CE.
$event1 : Event(eventNo == "A")
not Event(eventNo == "B", this after[5s] $event1 )
A negated condition with respect to time still requires an EventB to be
present,
but with a constraint on (relative) timestamps.
Also, note that the startedby operator has a semantic that implies durations
for both events, which is not in your requirement.
-W
On 26 October 2010 07:11, david.bao <david.lg.bao(a)gmail.com> wrote:
Hi,
I'm a newbie of Drools Fusion. I have a requirement as following:
If Event A is inserted into the working memory and in the following 5
seconds there is no Event B, some action will be performed.
Here is my rule script
import com.foo.event.Event
rule "test"
when
$event1 : Event(eventNo == "A")
Event(eventNo == "B", this not startedby [5s] $event1 )
then
System.out.println("there is no Event B in 5 seconds");
end
Java code:
session.insert( event1 );
clock.advanceTime( 6, TimeUnit.SECONDS );
session.insert(event2);
session.fireAllRules();
this works. But if i do not insert event2 and the rule will not be fired.
I also tried
not Event(eventNo == "B", this startedby [5s] $event1 )
not work also
Thanks
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/CE-not-tp1771908p1771...
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