Best practice for global report by exception alarm trigger

I have a script that I want to run every time a new alarm is active/cleared. This script updates a bunch of graphics and tags. Currently that script is located in a GW timer Script that runs every 10 seconds. I would prefer if I could trigger this script only when an alarm active/cleared event is triggered. Running the script every 10 seconds will become resource intensive as the project grows.

I was thinking of using the alarm notification module (which we already have) as a way of handling alarm events in a “report by exception” manner instead of a polling manner. But then I would be creating a pipeline that triggers a script and not notify anyone.

Is this the best way to achieve this or am I overcomplicating it by making use of an additional module? Is there a simpler/ best practice approach?

Not a bad idea, but you'll want to avoid excess runs when a bunch of alarms come in together. Consider having this special pipeline just updata a timestamp, for the 10-second timer to act on. Something similar to this idea:

1 Like

@pturmel thanks, also not a bad idea. Ironic, I am actually also using this script to update map component pin colours (among other things).