|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Showing only one messagePlease I need some help with this, I need to make somekind of an alert manager, that only the first time that an specific event arrives it shows a message in the console. If some more events of the same kind arrives after the first one, they need to be ignored until another type of event arrives, which will be the event that shows that the alert was handled...
I need some directions on how to make this on esper... Is there a way of doing this without having a boolean in my code that tells the listener to ignore the incoming events that arrives after the first one??? How is this done with esper???? Please help! |
|
|
Re: Showing only one messageHi!
I would use multiple patterns and the followed by operator (->). This should work if you for instance try to be alerted whenever a threshold is exceeded. select * as highValue from input where (input.value > x) select * as lowValue from input where (input.value <= x) select highValue as alert from pattern [every (lowValue -> highValue)] You will get an 'alert' event every time the values of your input change from below the threshold to above. Simply invert the last pattern to produce 'all-clear' events. Hope this helps, Thomas 2009/10/7 jgoldman <goldman.jorge@...>
-- Dipl.-Geoinf. Thomas Everding Research Associate Institute for Geoinformatics, University of Muenster http://ifgi.uni-muenster.de http://swsl.uni-muenster.de |
|
|
Re: Showing only one messageAn option can be to use named windows, insert the event into a named window then use a subquery against the named window to figure out whether to alert or not, and an on-delete to delete from the named window to free up for the next possible alert. -Tom From: Thomas Everding <t.everding@...> To: user@... Sent: Wed, October 7, 2009 11:16:38 AM Subject: Re: [esper-user] Showing only one message Hi! I would use multiple patterns and the followed by operator (->). This should work if you for instance try to be alerted whenever a threshold is exceeded. select * as highValue from input where (input.value > x) select * as lowValue from input where (input.value <= x) select highValue as alert from pattern [every (lowValue -> highValue)] You will get an 'alert' event every time the values of your input change from below the threshold to above. Simply invert the last pattern to produce 'all-clear' events. Hope this helps, Thomas 2009/10/7 jgoldman <goldman.jorge@...>
-- Dipl.-Geoinf. Thomas Everding Research Associate Institute for Geoinformatics, University of Muenster http://ifgi.uni-muenster.de http://swsl.uni-muenster.de |
|
|
Re: Showing only one messageCould you please give me an example, Tom???
I am not a very experienced proggrammer, and my boss is going to kill me... thanks
|
|
|
Re: Showing only one messageI have tried something like:
String expressionTextIgnoreAlarms = "select * from pattern [alarmevent=AlarmEvent() -> middleevent=AlarmEvent() until disarmalarmevent=DisarmAlarmEvent()]"; EPStatement factoryIgnoreAlarmEvent = epService.getEPAdministrator().createEPL(expressionTextIgnoreAlarms); factoryIgnoreAlarmEvent.addListener(new IgnoreAlarmListener()); But it did not work and I don't know why...
|
| Free embeddable forum powered by Nabble | Forum Help |