Triggers

In this section it is possible to set scripts which are executed with creation or deletion of an object of the corresponding class.

Learn more about scripts and configs in the article Scripts execution with object creation and deletion.
image
Scripts, which are executed with object creation, also executed with cloning of object of the corresponding class.

Below is a list of variables that can be passed as arguments in double braces like {{variable_name}}:

  • {{body}} - stringified object body,

  • {{class_id}} - object class,

  • {{client_data}} - data which affect object displaying in the native web interface:

  • {{created}} - object creation time,

  • {{geoposition}} - geoposition,

  • {{geopositionRadius}} - geo radius on the map,

  • {{id}} or {{entityId}} - object ID,

  • {{last_state_update}} - time of the [last change of the object state,

  • {{name}} - object name,

  • {{parent_id}} - array of IDs of parent objects,

  • {{state_id}} - state ID,

  • {{tags}} - tags,

  • {{updated}} - time of the last change of the object.

It is also possible to pass object properties by their names: {{properties.property_name}}

Example:

image

With creation an object of the Host class, the script Emergence.sh is executed. The following is passed to the script as arguments:

  • the object name,

  • the object creation time.

With deletion an object of the Host class, the script Demolition.sh is executed. The following is passed to the script as arguments:

  • the object name,

  • the value of the IP property of the object.