Thursday, 29 August 2013

Talend Pass context parameters from command line to talend job


Passing context parameters from commandline to talend job


Many times we need to pass context parameter value from commandline while executing talend job batch file (- this is batch file (.bat/.sh) which gets generated when we export job from talend studio or talend commandline)

We can make use of --context_param switch in commandline while executing talend job from command line.

Example - Consider this simple job which has two context parameters param_01 and param_02 and displays these context variables in console window output.

Pass context parameter job


context parameters with default values


Now when we run this job after exporting this job from talend studio we get following results which displays the default values of context parameters



run job with no value passed for context parameter




Now to pass values for these context parameters we can call this job as below (even you can edit .bat file and do the needful - passcontextparam_run.bat --context_param param_01="test01" --context_param param_02="test02")

run job with context parameter value passed