A template can be used to declare a module using the Apply keyword.
Templates can be used everywhere a module can be used: Both in a device's module list and the document-level module list.
- To use a template, at least the template's name needs to be specified.
- If the template uses placeholders, values for these placeholders need to be specified using the
Argumentsproperty:- Specifying arguments is optional if the template does not use placeholders or specified default values for all placeholders.
- If the template specifies allowed values for a placeholder, only one of the specified values may be used in the arguments.
The following example shows the structure of a template usage:
{
"Devices": [
{
"Name": "Device1",
"Modules": [
{
// The structure of the module where the template with the variables is applied
},
{
"Apply": {
"TemplateName": "DQ_Template",
"Arguments": {
"ModuleName": "DQ",
"OutputAddress": "64"
}
}
}
]
}
]
}
TemplateNamespecified the name of the template to apply.Argumentsspecifies the template arguments as a list of key-value pairs.- The key is the name of the placeholder.
- The value is the value to use for the placeholder.