Working with Templates
Templates allow you to design many similar connections efficiently and consistently. Typical use cases include connections that differ only in individual values, such as data points, table names, IDs, or connection names.
Overview of Terms
Template
A template is the basic framework of a connection. It contains all the fixed parts of the configuration.
Template Variable
A template variable is a placeholder within the template. You use it to define the values that may differ between individual connections.
Instance
An instance is a specific connection created from a template. To do this, you populate the template variables with specific values.
Dynamic Instance
A dynamic instance is a connection created at runtime using database entries. It is suitable for scenarios in which connections are not only configured once but are later created or modified automatically.
How to Work with Templates
- Create a template and configure all the fixed parts of the connection within it.
- Define template variables at the variable points.
- Create specific instances from the template.
- Put the instances into production or, if necessary, create dynamic instances at runtime.
Methods for Creating Instances
Depending on the use case, there are three typical approaches:
- For individual connections, create an instance manually and enter the values directly in the dialog.
- For many similar connections, create multiple instances from a file or a table.
- For automated scenarios, create dynamic instances at runtime using the Dynamic Instances API.
Notes on Template Variables
Template variables are type-safe. Therefore, always use the appropriate variable type for the intended purpose.
A combination of multiple template variables or a combination of template variables and additional text within an expression is only possible with variables of type “String,” for example, bp=Objects/2:{Machine}/2:SPS/2:Heater1;.
The following pages provide step-by-step instructions on how to create templates, generate instances, and use dynamic instances.