[rules-users] please provide a rule for events timeout cases

Wolfgang Laun wolfgang.laun at gmail.com
Mon Apr 16 06:43:16 EDT 2012


You might use a timer:

rule no_response
   timer( int: 10s )
when
   EventRecord( type=EventRequest, id=1 )
   not EventRecord( type=EventResponse, id=1 )
then
  // ... no matching response after 10s
end

-W



On 16/04/2012, skatta1986 <shivaprasad_gdk at yahoo.co.in> wrote:
> Hi,
>
> For the first time even I have tried the same. But it doesn't work.
>
> I need to correlate the events on live. I am using fire rule until hault
> (ksession.fireUntilHalt()).
>
> EventRecord(type=EventRequest, id=1)
> not EventRecord(type=EventResponse, id=1, this after [1s,10s])
>
> This rule doesn't work because when EventRecord(type=EventRequest, id=1) hit
> working memory, this rule also looks for EventRecord(type=EventResponse,
> id=1). As the EventResponse doesn't the working memory, "not" logic become
> true and executing the R.H.S part as soon as EventRequest arrives. This is
> not waiting for 10seconds time interval.
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/please-provide-a-rule-for-events-timeout-cases-tp3907955p3914047.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list