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

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