I want to send notification when alarm is generated first and if the alarm is keep on generating and not acknowledged, i dont want to send notification when every time the alarm is created(ex. every minute) instead i want to send the notification only once in day, after the alarm generated In Apama EPL.
help me with the code snippet for Apama Epl.
You might find the count member of the Alarm event useful. This will be 1 the first time the alarm is triggered so can be used for filtering in an on statement in order to send a notification.
If alarms are generated at very regular intervals (for example, exactly every minute) then it might be sufficient to listen for alarms with status “ACTIVE” that have a count divisible by the number of minutes in a day using the modulo operator to get reminders roughly every day. It is possible this method of filtering has not been implemented. Alternatively, you could start a 1 day timing listener in response to the first alarm event (see the wait operator) that stops (is cancelled) if an alarm event is received with ACKNOWLEDGED or CLEARED status.
on all (wait(5.0)) and not Alarm(status!="ACTIVE")
This uses the and and not event listener logic.
Rather than starting a timer for each alarm you could alternatively query for alarms that are active at a particular time each day.
This can be achieve by defining 2 EPL apps, one will listen only new active alarm where count is 1 and send notification
And another EPL can be run at any particular time daily to fetch all the alarms that are still active and created date is older than today.