Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dynamically run a job.

Hi,
Im trying to create a "Master" job that controls a batch process, in my case it would be a very big plus to be able to start a non specific job using a component like tRunJob.. Standard its possible to select a job that needs to be started (hard coded) in the tRunJob component but what i want to do is to decide at Run time by passing this component a parameter (eg the name of the job)
if this is not possible i was wondering if it could be done by creating a new routine that can be used (called) with a tJava component, whats your opinion about this? and have u got some suggestion? code examples? all help is welcome!
Kind regards!
Albert
Labels (3)
20 Replies
Anonymous
Not applicable
Author

Hi
Standard its possible to select a job that needs to be started (hard coded) in the tRunJob component but what i want to do is to decide at Run time by passing this component a parameter (eg the name of the job)

Yes, you can pass a parameter Dynamically to the child job via tRunjob component.
I have created a simple scenario:
source file:
1;shong;20
2;Elise;30
3;plegall;39

child job: define a context:name, there is only a tJava component.
father job: use tRunjob component to run child job and pass a parameter danamically to child job.
Please see the screenshot.
Feel free to post your questions!
Best regards
shong
Anonymous
Not applicable
Author

Hi,
Thanks for the quick reply and good example! Actually i meant something different, i was wondering if i could tell the tRunJob component
what job to run by passing it a parameter (like the job name) at run time, but standard the tRunJob component can run only one specific job (determined when u choose from the drop down list inside the components properties) not at run time and not dynamically (the job to run is chosen during the design and hard coded) so for example lets say that i have the following jobs:
-MainJob -> decides what job to start.
-Job1 -> small job that does something simple
--- ---
-Job60 -> ---
It would be possible to make a MainJob with 60 tRunJob components that all start a different Jobx jobs but what i want is some
tRunJob component that i can tell (by passing some parameter) what job to run (at runtime). So a tRunJob component that can start a job just by telling the tRunJob component what job to run.
for example lets say that u have a loop and that u want to start job1 ... job60 with 1 tRunJob component just by telling tRunJob what job to run so something like this:
tRunJob(start job1) ..... tRunJob(start job60)
It seems to me that this is not possible with the current tRunJob component so i was wondering if it is possible to create some routine that can do the same as tRunJob but do this for any job at runtime.. something like this maybe:
StartJob(String jobName, String[] jobParameters) this can than be started from a tJava component?
So the Mainjob can use the tJava component to call some routine with the appropriate parameters (jobname and job parameters) and start the job with these parameters.
so basically the same functionality as the tRunJob component but with the option to chose a job at runtime, whats your opinion about this? is this possible?
Thanks for the help shong!
Kind regards,
Albert
Anonymous
Not applicable
Author

Hi
Your issue is intereting for me!! I will discuss it with other members in Talend or report a new feature on our bugtracker.
Thanks for your support!
Best regards
shong
Anonymous
Not applicable
Author

Hi,
thanks! It would be nice to have such a feature could really help when creating some form of runcontrol job 0683p000009MACn.png
Kind regards,
Albert
Anonymous
Not applicable
Author

Hi
There is a relevant 1859.
Best regards
shong
Anonymous
Not applicable
Author

Hi,
Thanks for your help and feedback,
simone's description (in the bugtracker) is very recognizable 0683p000009MACn.png
btw, the export part is a problem right? isn't it possible to just show a popup menu that allows the manual selection of jobs to include
in the export if a job is exported that contains a tDynamicRunJob (doesn't exist yet) component??
then it will be up to the user to decide/be responsible for the jobs that can be fired by tDynamicRunJob.

Kind regards,
Albert
Anonymous
Not applicable
Author

Hi,
I think we will work again on this feature, but in this case it will be planned for the 2.4 (too late for a 2.3 now).
As you've seen in the feature, the 2 main problems for this are on the export and when using in TOS.
For the export, as you said with a dialog with like a tree to select the jobs to include, it should be possible (or add like a dependency from one job to another one also)
After there is still the problem of execution in TOS as it will be really slow. If you execute the main job, it will look for the first job to execute, generate the code of the first job, then execute, then generate the code of the 2nd job, then execute etc...
(but if the user knows it's recommanded for "test only", it's ok maybe).
Nicolas
Anonymous
Not applicable
Author

Hi,
Could somebody confirm if v2.4.0M1 covers this feature request?
Thanks,
Rajiv
Anonymous
Not applicable
Author

Could somebody confirm if v2.4.0M1 covers this feature request?

I confirm this feature is not present in 2.4.0M1. As you can currently see in the bugtracker, 1859 is not fixed yet. It has even no "target version", ie it's not in the roadmap yet.