List of Decorators

@trigger

This must be the first decorator - it marks the function as a trigger function that needs to be added to the system.

@trigger

@data

Takes an array of point names as a parameter. These are the points of data that will be loaded from ARDI. They can be used in both your trigger and condition functions.

Each point is in the form of ARDI Asset Name.ARDI Property Name.

@data('My Point.One','My Point.Two')

@when

Specifies the condition function. This function must change state to cause the trigger function to be run.

A function - often a Lambda-Function - must be passed to the decorator.

You can access the data values with the Value and Values array in the Trigger object that is passed to the function.

@when(lambda o: o.Value() > 110)

Function will be triggered when the value of the first Data property is greater than 110.

@changes

The trigger function will be run whever the condition function changes state - regardless of which state it changes to.

@risingedge

The trigger function will be run only when the condition function changes to True

@fallingedge

The trigger function will only be run when the condition function changes to False

@repeat

The trigger function should be called whenever the condition function becomes True, even if it was previously true.

NOTE: The @delay and @repeat options are not compatible with one-another

@searchtime

Modifies the maximum BackTracking search time, in minutes

@searchtime(60)

If backtracking is required, search 60 minutes of history (default is 30)

@delay

Controls the amount of time to wait between the condition-function changing state and the trigger-function executing.

The trigger function will not execute if the condition-function returns a different state during that time. For example, if you're triggering on the value moving from False to True with a delay of 5 seconds, the condition function must remain True for the entire five seconds.

This delay is primarily used to avoid issues where your values are very close to the trigger point - sensor drift may cause a particular condition to flicker from True to False rapidly.

Special Decorators

The decorators @server and @attach are used in dynamic attachment and are discussed further on that page.