One Star

implicit context load from file controlled by call paramter

Hi,
So far I'm just a small step away from getting my first TOS-job into production ...
My job scans a directory, converts data and writes it to an output path.
I use implicit context load from file to provide the configuration (input/output-path, filepattern ...)
For a different purpose I need to change the configuration. That means I need 2 sets of configurations.
My approach is to set the path to the configuration dynamically
e.g. jobname_run.sh -i <path-to-configfile>
Is this possible?
Any other hints?
Thanks a lot
Günter
4 REPLIES
Four Stars

Re: implicit context load from file controlled by call paramter

Hello,
Yes, it's possible: you can use a context variable for the context file. (as an example: context.contextFile).
When your job is exported, you can use --context_param parameter.

e.g. jobname_run.sh --context_param contextFile=C:/Talend/prod_context.properties
One Star

Re: implicit context load from file controlled by call paramter

This is my modified run-script
cd `dirname $0`
ROOT_PATH=`pwd`
java -Xms256M -Xmx1024M .... --context=Default --context_param contextFile=/home/xxx/tos_xxx.cfg $*
This doesn't work. The job still uses the default path provided in TOS "/Job/Extras"-Tab.
One Star

Re: implicit context load from file controlled by call paramter

Really nobody who can advice?
I checked the doc but didn't find anything helpful!
Community Manager

Re: implicit context load from file controlled by call paramter

Hello
I have tested with TOS3.1.2 on linux systemand it works fine. Please check your file path and var name if it is correct, note that case sensitive.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business