Templates List
All available Templates, successfully created after:
• its bundle or file is installed/loaded
• a REST or JSON-RPC request
• a Web Console action:
• using the Add button
under the Actions column
• using the Copy button
to create a similar template, which can be easily updated
• using the Create Template button
from the Rules tab
can be viewed in a sortable table under the second main tab:

A Template can be added, updated, copied, used for creating a rule, or removed via the corresponding buttons from the Actions column, as described further.
Some templates, provided to the system not via the Web Console, but by a file or a bundle, are updated or removed when the providing file/bundle is updated or uninstalled.
It is also described how to create a Rule from a template with the respective button
.
Template Details
To see the template details use the Details button
, or simply select the template UID from the first column of the table.

This page is not editable. It contains general information and details about the Variables, Triggers and Flow if available. If a Handler is used, a click on its UID provides more details, including its Inputs/Outputs.
Creating a Template
To create a template via the Web Console:
Adding a New Template
Clicking on the
button right under the Actions column opens up a page to fill in the General information fields, like UID, Name, Description, Tags and adding Variables, Triggers and Flow by
buttons. A convenient way for choosing among available types, Triggers and Flow is provided from a drop-down menu:

Adding Variables
The Add variable dialog box appears after a click on the add button
:

It allows choosing from the possible types of GENERIC, NUMERIC, ENUM, BEAN and ANY from a drop-down menu:

If a single variable is added successfully, it can be updated and removed, using the corresponding buttons –
. When there are more than one variables, two more buttons appear under the Actions column to allow moving a variable up and down conveniently in the table:
.
Adding Triggers
Before adding a trigger choose its type from the drop-down menu:

After the add button
is clicked a table appears. It corresponds to the type of the trigger – with empty spaces or with available or proposed value and drop-down menus for choosing from existing options:

The fields marked with asterisk - *, are mandatory to successfully run a rule created by a template.
Adding a Flow
To add a flow first choose one of the available Action or Condition handlers from the drop-down menu and then click on the add button
.

To avoid entry mistakes when providing the data, corresponding to the selected handler in the right format, there are Drop-down menus. They provide options according the type, displayed in the metadata tooltip:

If more than one Action or Condition handlers are used, move up and down buttons appear for ordering the Flow table in a preferred way. After all data is filled in, a click on the Add button saves the whole template.

The fields marked with asterisk - *, are mandatory to successfully run a rule created by a template.
Copying a Template
The Web Console facilitates the process of creating new templates via the copying action:

It provides the whole information of the original template with an empty UID field for the new one.
In case the UID field is left empty, the Web Console provides a system UID.

If the user added UID is already in the system, an error message appears prompting for unique UID.
Updating a Template
The templates, which are added through the Web Console as described above, may further be updated.
At present the Web Console does not allow update and removal of templates, which are added to the system by files or bundles. The are updated or removed only if the files/bundles are updated or uninstalled.
For those templates there are no update or remove buttons:

To update a template, added by the Web Console, just click on the Update button
. Updating a template is similar to the adding a template action, except that the template UID cannot be changed.

Clicking on the Update button saves the operation.
When a Template is updated by copying the template, both templates exist in the list.

Creating a Rule from a Template
The Web Console allows you to create a rule by template via the Create rule button.
The example below uses the template created as described in "Using a Rule to Create a Template" section from Rules guide.

Pressing the Create rule button
opens Create rule from <name_of_template> box where you can provide UID of the rule and values for the defined template's variables.

The metadata information for each variable is provided in the tooltip, where available:

After pressing the ADD button a new Turn Off Heating rule will be created from the template.turn.off.heating. For its JSON representation refer to "Turn Off Heating Rule Example" section from Rule JSON Examples.
Removing a Template
To remove a Template simply click the Remove button
, situated in the Actions column of the Templates list.

If the Template is removed successfully, it disappears from the main table.