When defining template placeholders, an optional list of allowed values can be specified. This allows limiting which values can be specified when a template is used.
The following example shows the usage of allowed placeholder values.
The OutputAddress placeholder is restricted to be either 32 or 64, so users of the template can only choose between these two values for the module's output address.
In the example, AllowedValues is combined with a default value, so users of the template can optionally choose to use an output address of 64 but 32 is used if no value is specified. The validity of the AllowedValues is only verified when they are applied.
{
"Templates": {
"Modules": [
{
"Name": "DQ_Template",
"Placeholders": [
{ "Name": "ModuleName" },
{
"Name": "OutputAddress",
"Value": "32",
"AllowedValues": [ "32", "64" ]
}
],
"Content": {
"Name": "${ModuleName}",
"TypeIdentifier": {
"OrderNumber": "6ES7 522-1BL01-0AB0",
"Version": "V1.1"
},
"IoConfiguration": {
"OutputAddress": "${OutputAddress}"
}
}
}
]
}
}