Before the system runs a step, it creates the step environment.
The step environment consists of all variables applicable to the step.
The variables are inherited from the server environment, project environment,
and step environment in order. The following is the basic case.
- Server environment: server environment variables are copied to
the step environment.
- Project environment: project environment variables are applied
to the step environment. If the project environment contains a variable
of the same name as a variable in the server environment, then the
value is updated according to the Variable Action in both variable
definitions.
- Step environment: step environment variables are applied to the
step environment. If a variable in the step environment has the same
name as a variable inherited from the server and project environments,
then the value is updated according to the Variable Action.
The variable action for a variable directly affects how values
are applied as they are inherited. For example:
- Case 1: values overwritten through inheritance when variable action
is Set
- Server environment: X = 1, action: Set
- Project environment: X = 100, action: Set
- Step environment: X = 3, action: Set
- Final value during step execution: X = 3
Variable X is set to 1, then 100, then 3. The variable action
of Set replaces the variable value each time a new value is applied.
- Case 2: values inherited because of variable action Set if Not
Set
- Server environment: Y = 1, action: Set
- Project environment: Y = 100, action: Set
- Step environment: Y = 3, action: Set if Not Set
- Final value during step execution: x = 100
Variable Y is set to 1, then 100 due to the Set action on Y in
the server and project environments. Because Y uses the variable action Set
if Not Set in the step environment, the value set in the
project environment is inherited.