One Star

tRunJob and tWaitForFile behaviors

Hi everybody,
I'm trying to start many job in parallel (they must all run independently, started at the same time by a super-job)
but can't find how to do it, they are always processed sequentially and if some of them fails, the super-job fails to even
if i use a tDie.
My project consists of two jobs, the super job named Main loads a context and then search for configuration files in a
directory defined by the context. For each of the found files, it must start a sub job named Product with the tRunJob and
passing it the corresponding configuration file.
The sub jobs must indefinitly generate xml outputs by being triggered by a new file in a directory, the xml ouputs goes
in a xml file to describe which files have been found and what are their caracteristics.
So the problem is that the subjobs are processed sequentially and so, only one of them is started because it continues
to wait for a new file, but i would like to have all the subjobs started and running indefinitly to deal with the new created files
specific to each Product subjob.
I let you see the joined schemas, tell me if you need more explanations
Thanks a lot
Jonathan
2 REPLIES
Community Manager

Re: tRunJob and tWaitForFile behaviors

Hi
About how to run the jobs parallel, please see the related 1779
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tRunJob and tWaitForFile behaviors

Hi shong
I have tested the "Multi thread execution" option as you told me, but it has no effect...
However, does enabling "Multi thread execution"
would make all tRunJob to be started in parallel and how could a "Run if error" or "Run if ok"
link could know when to be triggered in this case ?
In my opinion, the tRunJob should have a "Blocking" property to specificially make this component
wait for the end of the subjob run, rather than a global setup "Multi thread execution" .
I have re-generated all the project and I still have the following generated part of code :
...
currentComponent = "tRunJob_1";
tds_config.product.Product.runJob(new String[]
{ "--father_pid=" + pid + "", "--root_pid=" + rootPid + "", "--context=Default",
"--context_param ProductConfigFile=" + ProdFile.FilePath,
"--context_param MainConfigFilePath=" + (String) ((String) context.getProperty("MainConfigFilePath")) });
((java.util.Map) threadLocal.get()).put(errorCode, tds_config.product.Product.errorCode);
if (tds_config.product.Product.errorCode != null || tds_config.product.Product.status.equals("failure"))
{ throw new TRunJobException();
}
...
Which I think, seems to wait for the sub job completion
and would raise an exception an stop the super job in case the sub job fails
Any idea about why my subjobs are still ran sequentially and if the exception can be avoided ?
Best regards
Jonathan