One Star

passing context file at run time

Hi ,
Can we pass the configuration file(context file ) at the run time for executing the job ?
6 REPLIES
Community Manager

Re: passing context file at run time

Hi
The context configuration file stores the default value of context variable, the values are loaded before the job execution, if you want to load the value on the fly, you can use tContextLoad to load the variable value from a general properties file at the beginning of job.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

Re: passing context file at run time

Yes you can populate the context parameters values from file using tContextLoad component.
Also, you can pass the path of the config file from which the parameters will be populated at run time.
You can do this by passing the path of the config file to the job using following syntax:

TalendJobExecutable.sh/.bat --context_param <name of param>=<path of config file>
For more details refer post below:
http://www.vikramtakkar.com/2013/04/how-to-pass-context-parameters-to.html?m=0
One Star

Re: passing context file at run time

Hi Vikram ,
Thanks for your reply .
that is what i exactly want..
Thanks for your reply.

Re: passing context file at run time

Hi Vikram ,
Thanks for your reply .
that is what i exactly want..
Thanks for your reply.

Your Welcome Nikhilsh.
One Star

Re: passing context file at run time

Hi,
Can you guide me how to refer from the properties file in ETL projects at runtime where i have mentioned key/value details used as context parameters while developing.
Normally we create "PROJECT_NAME.properties" file which kept in a directory and that directory put in the classpath. The file has all the respective environment details as key/value (like database, directories info) which we have map in the context parameters while developing...
Its working in some project but not working in one project.
Thanks,
Lijo
Community Manager

Re: passing context file at run time

Hi Lijo
Use a tFileInputDelimited to read the properties file and link it to tContextLoad, the path of properties file should be an absolute path. I don't understand your mention 'Its working in some project but not working in one project.'.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business