One Star

only one context file for all job and subJobs

Hi,
Under TOS,
- I have 3 platforms : DEV, INT, PROD
- I have done 3 Context file : contextDEV.ini, contextINT.ini, contextPROD.ini with my parameters (not csv)
- I have done done a job (mainJob) with loading context file i need by a subJob (loadContextSubJob) and then call a subJob (subJobToDo) with "transmit whole context"
something as : mainJob :
loadContextSubJob --subjob ok--> subJobToDo
loadContextSubJob :
tFileInputDelimited --row1(main)--> tBufferOutPut
filename : context.rootProject + context.configProject + "/context" + context.platform + ".ini"
I would like to build an autonomous job of mainJob and add at end, parameters as follow :
--context_param rootProject="D:/rootProject/ --context_param configProject=/configProject --context_param platform=INT
to have the right filename in my loadContextSubjob
but I don't find the right way to build the mainJob to work well
I obtain a subDirectory for mainJob and a subDirectory for each subjobs,
with a subDirecory "context" with context files for each platform
such as :
myProject\mainjob\contexts\Default.properties, DEV.properties, etc..
myProject\loadContextSubJob \contexts\Default.properties, DEV.properties, etc..
myProject\subJobToDo\contexts\Default.properties, DEV.properties, etc..
if anyone can help me...
7 REPLIES
Four Stars

Re: only one context file for all job and subJobs

Hi ldelmas,
You have explained too much... it was difficult to understand...
By the way good practice is to
- create a standard xyz.properties file (as many as you like)... Specify all the path and required variables there
- Load it in main job based on the environment
- Load context to global using tContextLoad
- Enable transfer context to subjob for each job....
I think this is what you are looking for.
Thanks
Vaibhav
One Star

Re: only one context file for all job and subJobs

i didn't want only one properties file for all platform (default, dev, etc...)
I wanted one properties file per pltaform
my problem is that with a mainjob calling subjob
when i build mainjob
- if i check "context script" option then there is one directory for mainjob and one for each subjob, with one "contexts" folder with one properties file per platform (default.properties, DEV.properties, etc...)
- if i uncheck "context script" option, then there is no directory as below, but job fail because subjob doesn't have parameter
so, i don't find a way to have a mainjob with subjob, and build mainjob and manage only one set of properties files (with 1 per platform)
Seventeen Stars

Re: only one context file for all job and subJobs

hi all,
use --context in your command line.
When you export your Job, it create java command line with param --context = to the value of environment you have choosen.
Talend also generate context environment file when you build job under context folder as properties file.(in your case you should have INT.properties,DEV.properties & PROD.propoerties)
you 've already got everything to run your job with different context (env).
regards
laurent
One Star

Re: only one context file for all job and subJobs

yes, but what i would like is to have only one set of properties files to just modify those files if needed
and not have one set per subjob
to have as less as possible files to manage
Seventeen Stars

Re: only one context file for all job and subJobs

hi all,
make some more test and understand what you mean.
On export(build job) you've got context foR AND child job, creating multi-context folders.
Not sure if it's a bug or not !!!
If you delete unneeded repository it give you a "warning" but run 'til the end.
regards
laurent
Seventeen Stars

Re: only one context file for all job and subJobs

as we are using an 'automatic scripting command line' to compile and deliver process I hadn't noticed those behavior. Smiley Wink
To manage different environment context, we are often using 'implicit context load' for Main job & 'transmit whole context' (or only some of them like parameters to a function).
We're just manage one config file - the dev one - and values are changed by team involved in INT & PROD.
regards
laurent
One Star

Re: only one context file for all job and subJobs

If I have understand well,
implicit load means a "csv" file with one row per platform (dev, Int, prod...)
i would like to use a file structure as generated by talend after build
I done a "context file" per platform, and i have a job to load wich i want,
but in talend build screen
- if i do not check "generate context script" then talend load context file but don't apply variables to subjob
- if i check "generate context script" then talend generate 1 context file per platform and per subjob folder
i don't find a way to load my file structured as talend generates it, and make talend understand to apply to subjob, when job is builded (as it works in tos interface)