Top  | Previous | Next

Set Property

The set property block allows you to define or redefine a property on the alarm event. The value is created from the given expression, which can refer to other properties or the same. As described in the pipeline overview, settings modified in this way will only exist while the alarm is in the pipeline, they will not be stored to the journal, or show up in the status table. Depending on the scope of the set property, the value may only exist inside of one pipeline execution, or between changes in state of the alarm.

 

Scope

Local: The property is set on the alarm event instance. An "event instance" is created each time an event enters a pipeline. Therefore, a "local" property will affect that alarm as it moves through the pipeline, but it won't exist later when the alarm changes state (such as to cleared or acknowledged) and runs through the pipelines defined for those states.

Global: The property will be set directly on the alarm event. A single alarm event is used for all transitions, and is updated with information from each state. Therefore, setting a global property will mean that if the alarm is later processed through a different pipeline, such as when it goes to clear, the custom property will still be available.

 

Example:

If you want to attempt notification up to three times before stopping, you could create a pipeline that looked like [Notification Block]->[Set Property]->[Expression], with the expression looping back to the notification block (perhaps with a delay in between).

The Set Property block would look like:

Property Name: counter

Expression: coalesce({counter}, 0)+1

 

Note that the first time the block is hit, the "counter" property will not exist, and therefore the value will be null. The coalesce function returns the first non-null value, allowing us to start with 0. Another way to write this might be:

if(isPropertyDefined("counter"), getProperty("counter"), 0)+1

The "getProperty" function is functionally equivalent to simply referencing the property in brackets (ie "{counter}").

 

The expression block in this example would simply be: "{counter}<3".