Operations
In this section it is possible set predefined actions to execute by:
-
pressing the execution button in the section, in the context menu of the object/link, or on the widget),
-
trigger (see actions on state changes).
Events of operation launchings and results of operation executions are recorded into the log, indicating the time and initiator. |
Operations can be used in order to:
It is possible to add a set of default operations to an object class in the System configuration window.
This section is available only for users with rights to run operations. Only users with rights to manage operations can add, edit and delete operations. |
Control buttons:
| execute operation;
| change operation;
| delete operation.
In order to create a new operation it is necessary to click the button.
There are two operation types, the fields depend on the selected type:
-
Program / script execution runs executable file.
-
MQTT message sends a message using the MQTT protocol.
Fields description:
Field | Description in program / script | Description in MQTT | ||
---|---|---|---|---|
Name |
Operation name displayed in the web interface. |
|||
Type |
Dropdown list with available operation types. |
|||
Subtype |
Dropdown list with available subtypes:
|
|||
Arguments |
Dropdown list where arguments the script will be executed with are specified. |
|||
Topic |
MQTT topic to send message. |
|||
Message |
MQTT message text. |
|||
Description |
Explanation to the operation. |
|||
Show results in popup message |
If the slider is set to YES, then with execution of the operation the popup window will be displayed. The following is specified in the message:
The window is closed with clicking the button or with page refreshing.
|
The following variables can be used in operations:
-
{{id}} - ID of the object, in which the operation is executed;
-
{{properties.property_name}} - property value of the object, in which the operation is executed (the name of the property is specified in the variable);
-
{{jobId}} - ID of the executed operation;
The identifier is unique for each execution, details are in the REST-API documentation. -
{{user.id}} - ID of the user, who has executed the operation;
-
{{user.login}} - login of the user, who has executed the operation.
The variables are used in:
-
the topic and the message of the operation type MQTT message;
-
the script of the operation type Program/script execution - Script with text.