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 that 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, 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,
the value is updated according to the Variable Action.
Note: Java™ MJC supports different
environment inheritance from the Perl engine. In Java MJC, the variables are inherited from the
project environment, server environment, and step environment, in
that order.
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 the 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, 100,
and 3. The variable action of Set replaces the
variable value each time a new value is applied.
- Case 2: Values inherited due to the 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 and 100 for
the Set action on Y in the server and project environments. Due to
Y using the variable action Set if Not Set in
the step environment, the value set in the project environment is
inherited.