Rule and Action Templates
Templates are predefined blocks of code or functions that contain common logic. Templates make common logic reusable across different Rules and Actions. They help ensure consistency by allowing you to define a set of operations once and use them multiple times. Templates are separated by type; Rules and Actions, and can be used in Templates of the same type.
Notes when using Templates
Templates cannot reference themselves as this would create a circular reference and make the rule loop infinitely.
If a modification is made, the change is picked up by all items referencing the template.
You cannot delete a template once it is referenced.
Referencing one template inside another template allows trees of Rule templates that can be created with a Rule or Action at the root.
If a template tree is too deep, you may experience performance issues.
Templates can start with a Value or a Predicate. Action Templates start with an Operation.
Example: A template can be used to define the relationship between road elements that make up a roundabout. The parameters are the objects that define the roundabout, and the output is a geometry value. This template can then be used in all Rules that need to access roundabout geometries.
Parameters
Parameters are added to templates to pass in Values or Attributes. Parameters act as placeholders for the objects that the template will process. When you add a Template to a Rule or Action, the calling Rule or Action specifies which in-context objects to use as input parameters.
Parameters allow you to determine the class or type of data that the Template operates on.
Creating Templates
Create a Template using the New icon or via the context menu in the Navigation pane in either the Rules or Actions tabs. The object is defined in an
Read and Commit parameter to the template. A template can have zero to many parameters.
Note: Action Templates can only be inserted into other Actions.

Parameters can be added, removed, and changed even when the template is referenced.
Warning: If the first node of a Template has its type changed (eg. Predicate to Value) then any Rules/Actions using the template will lose functionality until the correct component type is used.
Using a Template
Templates can be used within Rules, Actions, or other Templates.

Templates automatically inherit the Class and Attribute parameters from the Root node at the point in time they are added. This can be manually changed if needed.