Actually I have tried this operator "after", but doesn't work properly as
the
events are inserted into working memory one by one within fraction of
seconds.
Consider EventRecords EventRecord(name=katta, eventType=REQUEST, id=1),
EventRecord(name=katta, eventType=EVENT_UN_AUTHORIZED, id=1) and
EventRecord(name=katta, eventType=REQUEST, id=2)
Drool:
when
($eventReq : EventRecord(eventType == "EVENT_REQUEST", respRecv ==
"false") from entry-point "AggStream")
and ($sipResp : EventRecord( eventType == "EVENT_UN_AUTHORIZED", name ==
$eventReq.name, id.getCallId()=r1.getId(), respRecv == "false", timeStamp >=
$eventReq.getTimeStamp(), this after[ 0s, 10s ] $eventReq ) from entry-point
"AggStream")
and ($eventReq2 : EventRecord( eventType == "EVENT_REQUEST", name ==
$eventReq.name, respRecv == "false", timeStamp >= $eventReq.getTimeStamp(),
this after[ 0s, 10s ] $eventReq) from entry-point "AggStream")
then
System.out.println( "++++++ Counter events : unauthorized2 event : "
+ $eventReq.getname()+", $eventReq.getId()="+ $eventReq.getId()+",
$eventReq2.getId()="+ $eventReq2.getId());
This rules give the below output:
++++++ Counter events : unauthorized2 event : katta $sipReq.getId()=1,
$sipReq2.getId()=1
++++++ Counter events : unauthorized2 event : katta $sipReq.getId()=2,
$sipReq2.getId()=2
But Expected output is:
++++++ Counter events : unauthorized2 event : katta $sipReq.getId()=1,
$sipReq2.getId()=2
--
View this message in context:
http://drools.46999.n3.nabble.com/is-there-any-followed-by-in-Drools-as-w...
Sent from the Drools: User forum mailing list archive at
Nabble.com.