Description
This step allows you to set variables in a job or in the virtual machine. It accepts one (and only one) row of data to set the value of a variable. Here are the possible scope settings:
- Valid in the virtual machine: the complete virtual machine will know about this variable.
Warning: this makes your transformation only fit to run in a stand-alone fashion. Running on an application server like on the Pentaho framework can become a problem. That is because other transformations running on the server will also see the changes this step makes. - Valid in the parent job: the variable is only valid in the parent job.
- Valid in the grand-parent job: the variable is valid in the grand-parent job and all the child jobs and
transformations. - Valid in the root job: the variable is valid in the root job and all the child jobs and transformations.
IMPORTANT : IT IS NOT POSSIBLE TO SET AND USE A VARIABLE IN THE SAME TRANSFORMATION. This is because all steps run in parallel.
Variable usage
Refer to Variables wiki page for a description of the use of variables.
The intention is not to use this step to overwrite variables set at a higher level, i.e. trying to overwrite Var1 in Transform1 for use in Transform2 when Var1 was set in Job1 which calls Transform1 and Transform2.
I have successfully used it to overwrite Var2 in the same Job (Job1) for use with different values in Trnasform1 and Transform2 before calling the respective trnasforms, but am also not sure if this is the indended use of this step.
Refering to PDI 3.1, the option "Valid in the grand-parent job" has been replaced by "Valid in the current job".