0

I'm new to Esper (NEsper, actually) and I've been trying (unsuccesfully) to create an statement to detect when an event starts.

For example, suppose I have an event type called "Started betting" and I want to consider it is happening after 10 minutes of having "proof" of that. With what I've been using as the statement, after 10 minutes the update() method is triggered every time there is "proof".

I've tried something like

from (...), StartedBetting as st 
where st is null AND (...) 

but didn't work (event was never detected).

Hope I've made myself clear.

Any hints will be appreciated.

Leti
  • 1
  • 1

1 Answers1

0

So if I understand you right, when receiving any start-betting event you simply want to delay for 10 minutes and then get called? The "proof" part is not clear. But this would do it:

select * from pattern [every StartBetting -> timer:interval(10 min)]
user650839
  • 2,594
  • 1
  • 13
  • 9
  • Thanks for answering! I'll try to explain the proof part: proof could be something like a discount in a bank account. I don't want to receive a "start-betting" event for every discount, but for multiple consecutive in a short period of time. However, once received, I don't want to receive any other of this type (the person has already started betting). That's why, sadly, your solution won't do the trick for me. I don't want to delay acknowledgement of the event. Hope this time I'd made myself clear. – Leti May 26 '17 at 02:51