Using a different context
If you have decided to use multiple contexts as a means of defining your runtime properties, then they can be selected at runtime using the following method.
Getting ready
Export the job jo_cook_ch11_0020_differentContext
, as shown in the previous recipe.
How to do it…
- Open a command window, navigate to the job directory, and execute the shell launcher for your environment (see previous exercise).
- You will see that the output contains the text Value = ABC.
- Open the shell launcher, and scroll to the very end of the command line.
- Change the context from
--context=development
to–context=test
as shown in the next screenshot: - Save the change, and then rerun the shell launcher.
- You will see that the output contains the text Value = DEF.
How it works…
The launcher file contains the command line used to execute the Talend job, one of whose parameters is the context being used by the job.
By setting the context variable to point to a different context, then the...