[rules-users] CE not
david.bao
david.lg.bao at gmail.com
Tue Oct 26 01:11:51 EDT 2010
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-tp1771908p1771908.html
Sent from the Drools - User mailing list archive at Nabble.com.
More information about the rules-users
mailing list