atom feed5 messages in org.codehaus.esper.dev[esper-dev] [jira] Created: (ESPER-29...
FromSent OnAttachments
shikha aggarwal (JIRA)Oct 7, 2008 11:16 am 
Thomas Bernhardt (JIRA)Oct 9, 2008 4:50 am 
shikha aggarwal (JIRA)Oct 9, 2008 5:47 am 
shikha aggarwal (JIRA)Oct 9, 2008 6:45 am 
Thomas Bernhardt (JIRA)Nov 8, 2008 7:47 pm 
Subject:[esper-dev] [jira] Created: (ESPER-294) Pattern problem in 'every' operator not restarting a false sub-expression.
From:shikha aggarwal (JIRA) (ji@codehaus.org)
Date:Oct 7, 2008 11:16:08 am
List:org.codehaus.esper.dev

Pattern problem in 'every' operator not restarting a false sub-expression.

--------------------------------------------------------------------------

Key: ESPER-294 URL: http://jira.codehaus.org/browse/ESPER-294 Project: Esper Issue Type: Bug Affects Versions: 2.2 Reporter: shikha aggarwal

Hi,

Below is the requirement which I am trying to achieve through ESPER.

When an event with status of "Pending" is recieved, it should keep checking
within the next 20 sec for an event of status of "Approved, The Transaction ID
of the transaction with the status "Pending" and "Approved" should be the same. If a Transaction event of status "Approved" is received within 20 seconds of
another Transaction event of status "Pending" with the same Transaction ID,
nothing occurs. If, however, the transaction event of status "Approved" is not
received within the cutoff time, an alert request is sent to the Alerts Engine.

The expression that I have written for the same is - select * from pattern [every a=TransactionApprovedEvent(status='Pending')->"(not
TransactionApprovedEvent(status='Approved',eventTransactionId=a.eventTransactionId)
and timer:interval(20 sec))]";

as per the documentation, My expectation is that for every event a where status
is pending the subexpression should be evaluated to check if an event of status
approved in recveed where the transaction id matched with the event a
transaction Id and it should do that for 20 seconds.

However , this only workd for the first time. Here is the test events that I am
firing -

BaseEvent tranEvent = new TransactionApprovedEvent("Transaction1",
"1",1,1,"Pending",3L); send(tranEvent); BaseEvent tranEvent1 = new TransactionApprovedEvent("Transaction2",
"2",2,2,"Pending",3L); send(tranEvent1); BaseEvent tranEvent3 = new TransactionApprovedEvent("Transaction3",
"5",5,3,"Pending",3L); send(tranEvent3);

Here send function send to the Esper EPRuntme.send the transaction Id is the
third field in the Transaction Approved Event(here 1,2,5). All the three events
are fired together without any time lag.

At ESPER Rumtime, only the first even is logged i.e. Transaction1 , none of the
others get logged.

Thanks Shikha