Home > Configuration > NS > setnsvariable_ifnovalue

setnsvariable_ifnovalue

Use this method to set action to perform if on a variable reference in an expression if the variable is single-valued and uninitialized
or if the variable is a map and there is no value for the specified key:
init - (default) initialize the single-value variable, or create a map entry for the key and the initial value,
using the -init value or its default.
undef - force the expression evaluation to return an undefined (Undef) result to the policy executing the expression.

Syntax



Parameters

name

Variable name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression).
This is mandatory parameter.

ifnovalue

Action to perform if on a variable reference in an expression if the variable is single-valued and uninitialized or if the variable is a map and there is no value for the specified key: init - (default) initialize the single-value variable, or create a map entry for the key and the initial value, using the -init value or its default. undef - force the expression evaluation to return an undefined (Undef) result to the policy executing the expression.
Default value = NS_VAR_IF_NO_VALUE_INIT.
Possible Values : undef, init.

Return Value

Returns simpleResult

See Also