Context variables are user defined variables that can be changed at runtime with different parameters and are a fantastic way to save time and help with collaboration among developers. These variables can be set with different values based on the environment they are run in (For example: test vs production), making it so you don’t have to build the same job more than once. These variables can be created within the job itself, or in the repository as metadata.
To create context variables in the repository you need to go into the repository and right click “Contexts”. This will allow you to create a new context group where you can give it the appropriate name, purpose, and description.
Once you fill out the context group details you can use the green plus sign at the bottom left of the window, where you can choose to add new context variables for your group. Once you have added a new context variable, create a name for your context variable, the data type, any comments you may want to add about your variable, as well as, a value.
Using the plus sign closer to the top right of the window will allow you to add different environments for your variable. Bellow, I created two different environments, “Production” and “Test”, with “Test” being set as the “Default”. Being a “Default” simply means that, if not specified, the value under the “Test” environment will be used for the context variable.
Now that you have created your context variable group you can find them in the same place you created them, the Repository. From there you can simply click and drag them onto the canvas to add them to your job, or you can select the “Contexts” tab in the Configuration tab section, then click on the context variable icon at the bottom left corner. In the tab you can also change the “Default context environment.” Don’t forget you can also reuse these variables as many times as you need to for multiple jobs.
Thanks for sharing it on forum.