Hi
I need to filter alarms on 2 conditions:
1 - first condition is "AlarmName" which is at the end part of the display path string eg. "TagFolder/TagName/AlarmName" - would using filterAlarm extension function be the right way? i was struggling with the syntax to get it right even in the simplest form.
def filterAlarm(self, alarmEvent):
AlarmDisplayPath = str(alarmEvent.get('displayPath'))
return "TagFolder/TagName/AlarmName" == AlarmDisplayPath
what about adding wildcards - is it allowed at all?
After prefiltering i could use tag path filter on display path again or on source
2 - alternatively instead using extenstion funciton i could use 1 condition for source (to filter AlarmName) and then use displayPath to filter alarms by tag name .
I wonder if both methods are equal - would extension function be a lot faster and preferred from performance point of view?
3 - how to figure out exact property names that are available in the extension functions for alarmEvent - "priority" was mentioned in the docs page but i wonder what else ? i could not figure out an exhaustive list 
What's the second filter ? The tag name ?
So you'd be filtering on alarm name and tag name ?
You can use wildcards in the filter properties, but not in the extension function: there's no wildcard in python.
For the extension function, you'd need to use a regex or use other built-in ways (ie: in
, startswith
, etc)
1 Like
You can effectively achieve the same end as a wildcards with simple string logic like this:
return "TagFolder/TagName/" in AlarmDisplayPath
1 Like
thanks for useful hints
regarding extension functions is expression language used or python or maybe both? this confuses me to know which syntax i am actually looking for
i already have a good gist but is it possible to say where expression language and where python is used - is any overall rule to that?
I generally associate expressions with bindings [not transformations], and python or jython is used pretty much everywhere else.
2 Likes
yes i am using Tag name as second filter
Filtering using displaypath for first condition and source for second condition works fine but i have deeper issue. I am not able to acknowledge alarms which are filtered but these alarms have fired and they add to the gateway alarm count for active/unacknowledge alarms which are then displayed. Is the only way to fix that to use extension function with reg-ex to pre-filter and prevent alarm from adding an entry and prevent from adding to the gateway alarm count statistics?