ThingWorx Model Definition and Composer > Alerts
  
Alerts
Alerts are a special type of event and use the event publish and subscribe mechanism. Alerts allow you to define rules for firing events. Like events, you must define a subscription to handle a change in state. All properties in a Thing Shape, Thing Template, or Thing can have one or more alert conditions defined. When new data for a property arrives, alert rules are evaluated. If an alert rule applies, an alert is created. A data packet is sent to the subscribers. Alerts are written to the alert history file and can be viewed through the Alert Summary and Alert History Mashups. The system tracks acknowledged and unacknowledged alerts. Alerts do not fire redundant events. For example, if a numeric property has a rule defined that generates an alert when the value is greater than 50, and a value = 51, an alert is generated and an alert event will fire. If another value comes in at 53 before the original alert is acknowledged, another event will not be fired because the current state is still greater than 50.
Alert types are specific to the data type of the property. The following base types can be used for alerts:
Boolean
Datetime
Infotable
Integer
Location
Number
String
After an alert is defined, a subscription to that alert can be configured to launch the appropriate business logic, such as notifying a user of an event (for example, through email or text message).
For information about AlertFunctions, see Resources.
To view a tutorial video on alerts, click here.
Monitoring Alerts
The Alert History and Alert Summary streams provide the functionality to monitor alerts in the system.
Alert History is a comprehensive log that records all information recorded into the alert stream, where the data is stored until manually removed.
Alert Summary compiles data from the last reset of the server to the current state. On the Alert Summary page, you can view, acknowledge, and sort (by acknowledged or unacknowledged) alerts.
1. From the ThingWorx header, choose Monitoring > Alert History.
All alerts are listed here.
2. Click the Alert Summary tab.
3. Click the Unacknowledged tab to view alerts that have not been acknowledged.
4. Choose to acknowledge an alert on a property or on the source. Type a message in the corresponding field.
5. Click Acknowledge.
Acknowledging Alerts
An acknowledgement (ack) is an indication that someone has seen the alert and is dealing with it (for example, low helium in an MRI machine and someone is filling it). You can view acknowledgements from Monitoring > Alert History. It shows when alerts were acknowledged and any comments.
You can acknowledge an alert on a property or on the source. A source acknowledgment acknowledges all alerts on the source Thing for the selected alert in Monitoring > Alert Summary. A property acknowledgment (ack) only acknowledges the alerts on the property for the selected alert in Alert Summary.
For example, you create a Thing with two properties that have alerts set up. You put both properties in their alert states. View Alert Summary and select the Unacknowledged tab. You should see two alerts. Select one, and do a property acknowledgement. The alert you selected moves to the Acknowledged tab and is removed from the Unacknowledged tab. Put both properties in their alert states again, select one of the alerts on the Unacknowledged tab, and this time do a source acknowledgement. In this case, both alerts move to the Acknowledged tab, even though you only selected one of them.
Overriding Alerts
You can override the threshold values on a Thing’s alert at run time so that it is specific to current operating conditions, which can override properties in an existing Thing.