system.alarm.queryStatus

Description

Queries the current state of alarms. The result is a list of alarm events, which can be queried for individual properties. The result object also has a getDataset() function that can be used to convert the query results into a normal dataset, with the columns: EventId, Source, DisplayPath, EventTime, State, Priority

Click here for more information on Alarm Properties

Syntax

system.alarm.queryStatus(priority, state, path, source, displaypath, all_properties, any_properties, defined, includeShelved)

  • Parameters

String[] priority - A list of possible priorities to match. Priorities can be specified by name or number, with the values: Diagnostic(0), Low(1), Medium(2), High(3), Critical(4).

String[] state - A list of states to allow. Valid values: "ClearUnacked", "ClearAcked", "ActiveUnacked", "ActiveAcked".

String[] path - A list of possible source paths to search at. The wildcard "*" may be used.

String[] source - A list of possible source paths to search at. The wildcard "*" may be used.

String[] displaypath - A list of display paths to search at. Display paths are separated by "/", and if a path ends in "/*", everything below that path will be searched as well.

Object[][] all_properties - A set of property conditions, all of which must be met for the condition to pass. This parameter is a list of tuples, in the form ("propName", "condition", value). Valid condition values: "=","!=","<","<=",">",">=". Only the first two conditions may be used for string values.

Object[][] any_properties - A set of property conditions, any of which will cause the overall the condition to pass. This parameter is a list of tuples, in the form ("propName", "condition", value). Valid condition values: "=","!=","<","<=",">",">=". Only the first two conditions may be used for string values.

String[] defined - A list of string property names, all of which must be present on an event for it to pass.

Boolean includeShelved - A flag indicating whether shelved events should be included in the results. Defaults to "false".

  • Returns

List - A list of matching AlarmEvent objects. AlarmEvent objects can be examined with getAckData, getActiveData, getClearedData, getCount, getDisplayPath, getDisplayPathOrSource, getId, getLastEventState, getName, getNotes, getOrDefault, getOrElse, getPriority, getProperties, getRawValueMap, getSource, getState, getValues, isAcked, isCleared, isExtended, isInherited, and isShelved.

Important

Each item in the resulting list is a combination of each alarm event for the same alarm: details for when the alarm became active, acknowledged, and cleared are combined into a single item. This differs from system.alarm.queryJournal() which splits these events into separate items.


  • Scope

All

Code Examples
Code Snippet
#This example queries the state of all tags named "HiAlarm", and puts the results in a table named "Table" (this assumes it's being run from a button on the same screen):
table = event.source.parent.getComponent("Table")
results = system.alarm.queryStatus(source=["*HiAlarm*"])
table.data = results.getDataset()