I've been working with Esper recently and there's a feature I missed in the documentation but it might exist.
I would like to store some events until no one pops up for 15 sec, and when it happens release them all.
One query does exactly that, it's :
select rstream * from MyEvent.win:time_accum(15 sec)
I can add a condition on the MyEvent like
select rstream * from MyEvent where status = 'ALARM_END'.win:time_accum(15 sec)
And this perfectly works.
Now I would like to add a condition on the eventType attribute saying that :
if a new event is triggered with eventType xxxx but there is already an event with eventType xxxx in the window then don't add this new popping event to the window (and therefore don't stop the stopwatch from 0 to 15s).
Is there a way to do that ?
Thanks a lot !
EDIT :
Looking more deeply into my need and ESPER documentation, I think my need is more satisfied with
select * from MyEvent.win:time_length_batch(15 sec, 2)
I don't think I need rstream as I just want to accumulate either 1 or 2 elements and get them all-at-once in an array (of new Events it's fine).
However, is it possible to add a condition on the first (and the first only) MyEvent coming into the window ? It is status = 'ALARM_END'.