Reevaluate() Action

The Reevaluate() action evaluates the current message for the expression rule again after a specified amount of time (for example, after two days), or on a specific date and time. When the Reevaluate action runs, all the data in Alarm-related messages, Data messages, and Location messages is refreshed to get the latest values from the Platform. For an Alarm message, this action updates the Alarm state, severity, and extended data. For a Data message, the most recent data item value is retrieved, and for a Location message, the most recent location is retrieved. For any other Rule type, the message data is not refreshed.

This action takes one parameter, timeSpan OR timeInSeconds. The timeInSeconds is returned from the Date() Function. The time span is in intervals of seconds, minutes, hours, days, weeks, months, or years.

Important! For the Reevaluate() action to run, you must enable the Consecutive flag for the expression rule.

If the trigger is InactiveAlarm, the Reevaluate() action re-runs the expression rule associated with the Inactivetrigger message if the alarm was first active and subsequently went inactive. If it started as inactive, then Reevaluate does not run the expression rule. The Reevaluate() action will refresh alarm data if the alarm was initially active and then went inactive.

Formats:

Reevaluate(String timeSpan)

Reevaluate(Long timeInSeconds)

where:

o        timeSpan - a string, enclosed in double quotation marks. This string specifies the amount of time. To define this value, use an integer (shown below as "n") and then one of the following to denote the unit of time:

§         "ns" for seconds

§         "nm" for minutes

§         "nh" for hours for days

§         "nw" for weeks

§         "nmo" for months

§         "ny" for years)

o        timeInSeconds - the absolute time, in the future; evaluated once, at the defined time, returned by the Date() function.

Tips

o        Be sure to use "mo" to differentiate "months" from the default unit for a timeSpan ("minutes", denoted by "m").

o        Be sure that you use the double quotation marks when specifying the string for a time span. Otherwise, the value entered is interpreted as an absolute time (the timeInSeconds parameter, which is a Long), which could be before the current time. Consider the following example:

Then: Reevaluate(60)

In this case, the absolute time 60 (ticks) is before the current time. For the action to run correctly (reevaluate in 60 seconds), the action should be written as follows:

Then: Reevaluate("60s")

o        Your Platform administrator defines the number of times the message can be evaluated. By default, this setting is 10, meaning that this trigger message is evaluated no more than 10 times. When the maximum value is reached, a warning message is entered in the audit log.

Examples

In the following example, the Date function identifies the exact time (in the future, in this case December 31, 2010) when the trigger message is re-evaluated

If: alarm.dataItemValue < 100

Then: Reevaluate(Date("12/31/10"))

The following example reevaluates the trigger message every hour, up to the maximum number of times configured for the Platform:

If: dataItem.value = 0

Then: Reevaluate("1h")

The following example reevaluates the trigger message every month, up to the maximum number of times configured for the Platform:

Then: Reevaluate("1mo")

The following example reevaluates the trigger message every 2 days, up to the maximum number of times configured for the Platform:

Then: Reevaluate("2d")

 

See Also