Previous Topic

Next Topic

Book Contents

Book Index

Creating a Rule Template (Deprecated)

Overview

There are several ways to create a new Rule Template:

Defining a JSON Rule Template Definition

The template below configures the 'operationName' and 'propertyName' properties and links the other required properties so the user of the template can configure them. It is available in the Automation ESH JSON Rules Demo and you can install it and see how it works.

[

   {

      "uid":"OnOffTemplate",

      "label":"On-Off Template",

      "description":"This template performs toggle operation on Functional Item with uid 'toggledFiName' when the state of Functional Item with uid 'triggerFIName' is changed.",

      "configDescriptions":[

         {

            "name":"triggerFIName",

            "label":"Trigger FI name",

            "description":"The name of the FI that triggers the rule",

            "type":"TEXT",

            "context":"fi_uid",

            "required":true

         },

         {

            "name":"toggledFiName",

            "label":"Toggled FI name",

            "description":"The name of the FI on which the operation will be performed",

            "type":"TEXT",

            "context":"fi_uid",

            "required":true

         }

      ],

      "triggers":[

         {

            "id":"FIPropertyChangedTrigger",

            "type":"item.FIPropertyChangedTrigger",

            "configuration":{

               "uid":"${triggerFIName}",

               "propertyName":"state"

            }

         }

      ],

      "actions":[

         {

            "id":"FIOperationAction",

            "type":"item.FIOperationAction",

            "configuration":{

               "uid":"${toggledFiName}",

               "operationName":"toggle"

            }

         }

      ]

   }

]

See also