I have a job that I want to execute with two different contexts.
In Talend, I have my two contexts set up, and it is quite easy to switch between them by selected one of them in the Run tab.
But after building the job, I am executing it by launching the .bat file, and there is only one context that is set up in the file (with the --context parameter). I have my two contexts in two properties file in the contexts folder, so I suppose that I just need to pass the right context into the --context variable in the .bat file, but I need to design a job where the user won't need to edit the .bat file.
I thought about passing a parameter into the --context variable in the .bat file, but I don't know how to proceed.
Is there someone who have an idea about this need?
You are able to define variable context value from the command line.
Please have a look at this online document:https://help.talend.com/reader/QrWkwPvKmKybs~JNLeBt3Q/bR16_SpzewPBtorvHtIgpA
Additionally, you can use tContextLoad component to load context variables dynamically from a delimited file(e.g.) as well when you run the job with different environments.
Is this solution OK with you? Feel free to post your issue on forum.
I think the most appropriate solution is to create two context files and load them through the command line. I did that and it seems to work fine. For the tContextLoad component, I'm not sure that it corresponds to my need because how do you choose which context you want to use when you have two contexts set up in the component? The user won't execute the job through Talend but only through a command line.
Join us at the Community Lounge.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Pick up some tips and tricks with Context Variables
Learn how media organizations have achieved success with Data Integration
Learn how and why companies are moving to the Cloud