Counting events between other events

View: New views
2 Messages — Rating Filter:   Alert me  

Counting events between other events

by nebulo-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

we need some help in creating an EPL-Statement which counts Events with
lets say paramA=1 that are received between an Event with paramA=2 and
an Event with paramA=3. All Events are of the same type.

We tried to use a pattern like below. But the problem is that all events
are counted not only Events with eventType=TYPE2.

select eventType, count(*) as TYPE2_COUNT from
pattern[beginevent=event(eventType="START") ->
middleevent=event(processInstanceID!=beginevent.processInstanceID) until
endevent=event(eventType="END",
processInstanceID=beginevent.processInstanceID)];

Best regards Sascha


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Counting events between other events

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Nebulo,

Since the "middleEvent" will be provided as an array, you use a UDF or have your listener output the length of the array.You could also look at the match_recognize and make a regular expression (A B* C) and select count(B).

Cheers
Tom

From: nebulo <nebulo@...>
To: user@...
Sent: Tue, November 3, 2009 1:13:00 PM
Subject: [esper-user] Counting events between other events

Hello,

we need some help in creating an EPL-Statement which counts Events with lets say paramA=1 that are received between an Event with paramA=2 and an Event with paramA=3. All Events are of the same type.

We tried to use a pattern like below. But the problem is that all events are counted not only Events with eventType=TYPE2.

select eventType, count(*) as TYPE2_COUNT from pattern[beginevent=event(eventType="START") -> middleevent=event(processInstanceID!=beginevent.processInstanceID) until endevent=event(eventType="END", processInstanceID=beginevent.processInstanceID)];

Best regards Sascha


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email