N1 Grid Service Provisioning System 5.0 Plan and Component Developer's Guide

Simple Substitution Variable References

The input source can contain any number of simple substitution variable references. A simple substitution variable has the following syntax:


:[variable]

variable is one of the following:

Predefined Component Variable Names

These predefined component variable names refer to the associated component attributes of the generation context:

Predefined component variables are always resolved relative to the actual component that is, or is being, installed even if the variable reference occurs in a base component. Predefined component variables are treated as PUBLIC variables.

Escape Sequences for Substitution Variables

If you want to include :[ in input source, you must escape it by using :[[ instead. The configuration generator replaces occurrences of :[[ with :[.

For example, to literally include the text :[box] without the provisioning system substituting a value for box, use :[[box].

When the input source is an attribute of a component that is authored in XML, the value is subject to the following rules for XML-based escape sequences:

These escape rules do not apply to override values input via the provisioning system's browser interface, configuration resource files, or input to the configuration generation CLI commands.

Substitution Variable Expansion

When a substitution variable reference is replaced by a variable setting value, the value is recursively expanded before being substituted. This expansion is necessary because the value itself might contain references to simple substitution variables. To prevent the substitution of values, escape input sources with :[[.

You can only use host and external component substitution references in default or override substitution values, parameter default values, and local variable default values. Such references are not permitted in other input sources.

Simple Substitution Variable Reference Expansion

The syntax for a simple substitution variable reference in a variable setting value is the same as for input sources:


:[varname]

In this case, the variable name that is referenced must be a variable that has been declared before the variable that contains the reference. This restriction prevents circular references.

For derived components, variables that are inherited from the base component are first expanded in the order of declaration in the parent. Then, local non-override variables are expanded in the order of declaration. Local variables that override inherited variables are expanded in place of the inherited variable in the same order that the inherited variable would have been expanded. Therefore, override variables can only refer to other inherited and override variables that have already been declared. For example, base component A declares variables x and y. Then derived component B declares variables z and y. The order of evaluation of variables in component B is x, which is inherited from component A, then y, which is overridden by component B, and finally z, which is local to component B.


Example 6–1 Using Simple Substitution Variables

The following table shows examples of substitution variables, as well as their expanded and unexpanded values.

Variable Name 

Unexpanded Value 

Expanded Value 

foo

silly

silly

bar

:[foo]

silly

baz

a :[foo] :[bar] example

a silly silly example

badFrob

:[frob]

Error – forward reference 

frob

:[[foo]

:[foo]

compName

:[sys.name]

Name of the target component 

badFoz

:[foz]

Error – foz has not been declared