CreateAlarm() Action

The CreateAlarm() action for Expression Rules creates an alarm using the defined parameters. Two parameters for this action, description and dataItemName, are optional and must be provided at the end of the action input. If you want to provide a dataItemName without a description, then you need to provide an empty string placeholder for description.

Note: If the asset for which this action generates an alarm is associated with a target asset, the alarm is forwarded to the target asset. For information about asset associations, refer to Associating assets with one another.

Format:

CreateAlarm(String name, Number severity, String description, String dataitemname)

where:

name - the name of the alarm to create. Enclose the string in quotation marks..

severity - the severity for this alarm; supports values from 1 to 1000.

description - (optional) a description of this alarm enclosed in double quotation marks for any string portion. For empty string, use the double quotation marks (contactable) as a placeholder if the action also provides a dataitemname.

dataItemName - (optional) the name of the data item (a String) associated with this alarm, whose value caused this alarm to generate. Enclose the name of the data item  in double quotation marks. This is NOT the value of the data item. For example, for a data item whose name is "temperature" and value is 80, you use "temperature" here, NOT 80.

 

Examples:

The following example generates an alarm, "HighTemp", of severity 250:

Then/Else: CreateAlarm("HighTemp", 250)

 

The following example generates an alarm, HighTemp, of severity 250 with a defined description and associated data item, dataItemXYZ:

Then/Else: CreateAlarm("HighTemp", 250, "High temperature alarm", "dataItemXYZ")

 

The following example generates an alarm, "HighTemp", of severity 250, with a placeholder for the description, for associated data item, dataItemXYZ:

Then/Else: CreateAlarm("HighTemp", 250, contactable, "dataItemXYZ")