variables:
Configuration variables made available to executed tasks and languages through the TaskVariables
object.
For more information about variables, see Variables.
Syntax
variables:
- name: string # name of variable
value: string | boolean | number | list | map # value of variable
delimiter: string # used for reference insertion and conditional append. Default is “,”
select: [condition] # return the value of the first true condition
- condition: boolean # boolean expression to evaluate to determine if value is returned
value: string | boolean | number | list | map # value of condition
append: [condition] # return all values whose condition is true
- condition: boolean # boolean expression to evaluate to determine if value is appended
value: string | boolean | number | list # value of condition
forFiles: string | [ string ] # glob file patterns for file associated variables
restricted: true | false # prevent application overriding. default is false
Properties
name
The variable name, used as the key when retrieving the variable.
value
The value of the variable. It can be any data type listed above and is returned as a copy of that object when retrieved from the TaskVariables
object.
As a value, a single-line reference will return the object of the reference. Multiple references or a single reference with other content in the value will always return a string.
delimiter
The delimiter on append variables, or a delimiter when replacing a non-single-line reference. In the second case, the delimiter applies to the replaced reference and any references it might contain until a new delimiter is explicitly declared.
This value defaults to a comma (,
) when undefined.
select
A select variable. It can provide different values based on the first satisfied condition. In this case, the value
field on the level above serves as a default value if no condition returns true
.
The value field in this definition follows the same rules as the one above.
For more information on the conditions, see Conditions.
Example:
# This example makes use of variables provided by the Language Task and comes from the
# Assember.yaml language definition.
- name: assemblerDDNameSubstitionList
value: "" # default is an empty string
select:
- condition: ${IS_CICS}
value: SYSLIN,,,SYSLIB,SYSPUNCH,,,,,,,,,,,,,,
- condition: ${IS_SQL}
value: SYSLIN,,,SYSLIB,SYSCIN,,,,,,,,,,,,,,
append
An append variable. It provides a way to build a string that contains values associated with satisfied conditions. In this case, the value
field on the level above serves as the starting value for the constructed value. The delimiter
is placed in between each value and defaults to a comma (,
) when it is undefined.
The value field in this definition follows the same rules as the one above.
For more information on the condition field, see Conditions.
Example:
# This example makes use of variables provided by the Language Task and comes from the
# Assembler.yaml language definition.
- name: compileParms
append:
- condition: ${IS_CICS}
value: CICS
- condition: ${IS_SQL}
value: SQL
- condition:
exists: errPrefix
value: ADATA,EX(ADX(ELAXMGUX))
- condition:
exists: debug
eval: ${debug}
value: TEST
forFiles
A single glob file pattern or list of file patterns used to associate variables with specific files. It is used only in Language Tasks and the UnitTest task when iterating over the source list.
restricted
A boolean value that, when set to true, prevents the variable from being overridden at a lower level. When a restriction is set on any variable type, it applies to any variable type defined at a lower level and results in an exception when violated. The available levels from top to bottom are as follows:
- Global variables
- Lifecycle variables
- Task variables
- Task variable overrides
- Runtime variables (set when the task is executing)