The SetAlarmState() action changes the state of the alarm that generated this expression rule. You cannot set the state of another alarm.
Alarms can be reported by the Axeda® Gateway agents, Axeda® Connector agents, or Axeda® IDM Agents, or by wireless assets. They can also be generated through Axeda Web services or SDK operations or from the Axeda® Connected Product Management Applications. Once an alarm is created, its initial disposition can be Started, Disabled, or Suppressed. Expression Rules are generated only by "Current" Alarms. Alarms with an initial disposition of "Started" are "current" and remain "current" as long as they are in the Started, Acknowledged, or Escalated states. These alarms can generate expression rules. They are available for evaluation in an IF statement of an Expression Rule and for state transitions through the SetAlarmState() action.
Alarms with an initial disposition of Disabled are discarded from the Platform and therefore never evaluated by an Expression Rule. Alarms with an initial disposition of Suppressed are sent directly to Historical Alarms (never becoming "Current") and therefore are not evaluated by an Expression Rule. Once a current alarm is transitioned to the Closed state, it is sent to Historical Alarms and no longer available to Expression Rules.
Notes:
If duplicate processing is enabled, duplicate
alarms are not available for expression rules. If duplicate processing
is disabled, then when an alarm is in any of the "Current" states
(started, escalated, or acknowledged) and the asset sends the same alarm
again, a new alarm instance is created and the original alarm is sent
to Historical Alarms.
To disable, enable, suppress, or un-suppress alarms, you can use Axeda
Platform Web services. In addition, you can perform these actions for
alarms defined for models
using the Axeda® Configuration application. To perform these actions for
alarms for individual assets, use the Alarm
Definitions page for the asset in the Axeda®
Service
application.
These actions affect only future alarms; they do not affect any current
or historical alarms.
The state is changed ONLY IF it is a valid transition. The check for a valid transition is made only when the expression rule runs, so while the Platform allows you to write the action in an expression rule, the state changes only if the transition is valid. The following table shows the valid transitions for alarms:
From this State |
alarms can be set to the following state(s): |
Started |
Acknowledged, Escalated, or Closed |
Acknowledged |
Escalated or Closed (or Acknowledged, again) |
Escalated |
Acknowledged or Closed |
Closed |
No other state |
SetAlarmState(String stateName, String notes)
where:
stateName - name of the state that you want to apply to the alarm. The following values are valid for changing the state name: CLOSED, ESCALATED, and ACKNOWLEDGED (STARTED is the state set when the initial disposition is Enabled and Unsuppressed; only the system can set an alarm state to STARTED).
notes - Optional; user-defined notes describing why the alarm state was changed.
The following example updates the alarm state to "ESCALATED" if the alarm severity is 500.
Trigger: Alarm
If: Alarm.severity == 500
Then/Else: SetAlarmState("ESCALATED")