The Alarm namespace is always the Current Alarm that generated the expression rule and that is being processed by the expression rule. When Alarm, AlarmStateChange, or AlarmExtendedDataChange are the triggers for an expression rule, you can use the symbols without the namespace (Unqualified format). Use this namespace with asset-related triggers and NOT with system-related triggers. For more information about which triggers you can use with the Alarm namespace, refer to Using Appropriate Actions and Namespaces with Triggers for Expression Rules.
When using the Qualified format, the syntax follows the form Namespace.symbol. Notice that the namespace always starts with a capital letter while the symbols are all lowercase letters. If the symbol provides an Enumerated list of values, those values must be all UPPERCASE. If the symbol provides a string that will be used in comparisons, that value will be case-sensitive. For example, use all uppercase to define an alarm state (Alarm.state == "ESCALATED"); make sure the extendeddata value is written in the correct case for comparison (If Alarm.extendeddata == "Critical" Then ).
Note: In addition to alarms generated by Axeda Gateway and Axeda Connector Agents, wireless devices, Axeda® Connected Product Management Applications rules, or Axeda Platform SDK or Web services operations, you can use faults (alarms) sent from Axeda® IDM Agents in expression rules. For example, you may want to convert the Axeda IDM Agent fault to a different type of Axeda Applications alarm. If using an Axeda IDM Agent alarm, you need to evaluate the content of the description symbol (all four components of the IDM Agent fault are put in the description field of the Alarm when it is received at the Axeda® Enterprise Server).
The following table shows the qualified and unqualified usage of the symbols for the Alarm namespace, shows the type of the return values, and provides brief descriptions and examples of the symbols:
Qualified |
Unqualified |
Returns |
Description |
Example |
Alarm.ack |
ack |
Boolean |
A value of True indicates that the alarm has been acknowledged. A value of False indicates that the alarm has not been acknowledged. |
To test for the value of true: If: Alarm.ack To test for the value of false, use the NOT (!) operator, as follows: If !Alarm.ack |
Alarm.age |
age |
Long |
The number of seconds since the alarm occurred. NOTE: When the alarm first arrives, the age is a very low number. The best way to handle the evaluation of age is to include an Else clause that prints the current age to the Audit log and then Reevaluates the Alarm message, as shown here: Audit("data-management", "age: " + str(Alarm.age)) && Reevaluate("65s") |
If: Alarm.age > 600 |
Alarm.dataitem |
dataitem |
String |
The name of the data item whose value generated the alarm. Note: This symbol is case-sensitive. |
If: Alarm.dataitem == "temp" |
Alarm.description |
description |
String |
Additional information provided by a user about the alarm |
If: has("Critical", Alarm.description) |
Alarm.extendeddata |
extendeddata |
String |
Custom (or user-defined) information for the alarm; for example, may be used to identify the state of the alarm or other user or client data. This provides extensibility when managing or processing alarms. Note: This symbol is case-sensitive. |
If: Alarm.extendeddata == "My extended data" |
Alarm.location |
location |
String |
The approximate location (mobile) of the asset when this alarm occurred. Note: This symbol is case-sensitive. |
If: Alarm.location == "Headquarters" |
Alarm.name |
name |
String |
Identifier assigned to the alarm. Note: This symbol is case-sensitive. |
If: Alarm.name == "Overheated" |
Alarm.previousextendeddata |
previousextendeddata |
String |
Previous custom (or user-defined) information for the alarm before the AlarmExtendedDataChange trigger fired. For example, may be used to identify the previous state of the alarm, or other user or client data. This provides extensibility when managing or processing alarms. Note: This symbol is case-sensitive. |
If: Alarm.previousextendeddata == "My previous extended data" |
Alarm.previousseverity |
previousseverity |
Integer; 1 to 1000 |
The previous severity of the alarm, before the AlarmSeverityChange trigger has fired. |
If: Alarm.previousseverity == 50 |
Alarm.previousstate |
previousstate |
String |
Available only when the trigger is AlarmStateChange, this symbol indicates the state of the Alarm before the state was changed. Can be one of the following values: STARTED, ESCALATED, ACKNOWLEDGED. Note: Must be all uppercase. |
If: Alarm.previousstate == "STARTED" |
Alarm.severity |
severity |
Integer; 1 to 1000 |
Number indicating the seriousness of the alarm. |
If: Alarm.severity > 10 |
Alarm.sourcedetails |
sourcedetails |
String |
Additional information about where the alarm was generated, which could be the full name of an expression rule or of an asset that generated the alarm. This symbol is available only for lookup. You cannot set a value for this symbol. Note: This symbol is case-sensitive. |
If: has("critical", Alarm.sourcedetails) |
Alarm.sourcetype |
sourcetype |
String |
Indication of where the alarm was generated. Can be one of the following values: ASSET (for any asset that is not running an Axeda Gateway Agent, an Axeda Connector Agent, or an Axeda IDM Agent) AGENT (for assets running Axeda Gateway, an Axeda Connector Agent, or an Axeda IDM Agent) EXPRESSION RULE OTHER (for Axeda Platform Web services and the Axeda Platform SDK). This symbol is available only for lookup. You cannot set a value for this symbol. Note: Must be all uppercase. |
If: Alarm.sourcetype == "OTHER" |
Alarm.state |
state |
String |
Indication of the current status of the alarm. Can be one of the following values: STARTED, ESCALATED, SUPPRESSED, CLOSED, or ACKNOWLEDGED. Note: Must be all uppercase. Once an alarm is created, its initial disposition can be Started, Disabled, or Suppressed. If Disabled, Alarms are discarded from the Platform and therefore are never evaluated by an Expression Rule. If Suppressed, Alarms are sent directly to Historical Alarms and therefore are not evaluated by an Expression Rule. If Started, the Alarm is Current and therefore available for evaluation in an IF statement of an Expression Rule or for state transitions through the SetAlarmStateAction action. |
If: Alarm.state == "ESCALATED" |
Alarm.time |
time |
Long |
The time that the alarm occurred, presented using the local time of the Platform, not of the asset. Note that this symbol returns the number of seconds since 1970 as the time, enabling you to subtract the current time at the server (Now function) from the time the alarm occurred to determine the age of the alarm (returns a Long). |
If: Alarm.time < Now()-60 |
Alarm.type |
type |
String |
The category of alarm. Can be one of the following values: LOW, HIGH, HIHI, LOLO, MAJOR DEVIATION, MINOR DEVIATION, DIGITAL, or DYNAMIC. Note: The values are an Enumerated List. Must be all uppercase. |
If: Alarm.type == "LOW" |
Alarm.value |
value |
String |
The value of the data item associated with the alarm state or range (optional). |
If: Alarm.value > "100" |
The following example shows how you can use the Alarm namespace and its symbols in an expression rule:
Trigger=AlarmStateChange
If Alarm.previousstate=="ESCALATED" && Alarm.severity < 10
Then SetAlarmState ="ACKNOWLEDGED"
The following example shows how an AlarmExtendedDataChange trigger can be used to run a rule that evaluates an Alarm state and extended data and sets the alarm to "Acknowledged" based on the results of that evaluation:
Trigger=AlarmExtendedDataChange
If Alarm.state == "ESCALATED" && Alarm.extendeddata == "My extended data"
Then SetAlarmState = "ACKNOWLEDGED"