Event Namespace

The Event namespace is always the current event that caused the expression rule to run, and that is being processed by the expression rule. When Event is the trigger 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 Event 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 a string that will be used in comparisons, that value will be case-sensitive.

The following table shows the qualified and unqualified usage of the symbols for the Event namespace, shows the type of the return values, and provides brief descriptions and examples of the symbols:

 

Qualified

Unqualified

Returns

Description

Example

Event.age

age

Long

The number of seconds since the event occurred.

NOTE: When the event 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 Event message, as shown here:

Audit("data-management", "age: " + str(Event.age)) && Reevaluate("65s")

If: Event.age > 600

Event.description

description

String

Additional information provided by a user about the event.

If: has("Critical", Event.description)

Event.name

name

String

Identifier assigned to the event.

Note: This symbol is case-sensitive.

If: Event.name == "Overheated"

Event.severity

severity

Integer; 1 to 1000

Number indicating the seriousness of the event.

If: Event.severity > 10

Event.time

time

Long

The time that the event 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 Platform (Now function) from the time the event occurred to determine the age of the event (returns a Long).

If: Event.time < Now()-60

Examples

The following example shows how you can use the Event namespace and its symbols in an expression rule:

 Trigger=Event

  If Event.name ==  "HighTemperature" && Event.severity > 500 && Device.model == "ServerModel123"

  Then CreateAlarm("HighTemperatureAlarm", 1000, "A high temperature alarm has occurred on " + Device.serial)

 

See Also