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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tJava and how to programatically trigger a tRunJob

Hello, 

Suppose i use a tJava component as a controller, this controller will trigger a subjob according to a param (context). My current workaround consist to use some if() statements inside the tJava, then according to the test i set something inside a globalMap and use a If--->[]---> link to all subjobs. Finally inside this If[] link i test the value in the globalMap and let the subjob run if the test is valid. 

context.task ---> tJava -----> IF(globalMap.get(...)) -----> SubJob
                   |-----------> IF[(globalMap.get(...)) -----> SubJob
                   |-----------> IF(globalMap.get(...))-----> SubJob 



However this is not scalable, reliable at all. I'm looking for a kind of Factory pattern that will take as an argument the context variable and will "Instantiate" / Run or call it like you want the subJob to avoid this messy code. 

Any Advices ? 

Thanks for kind support. 

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Take a look at ....
Scenario 2: Running a list of child Jobs dynamically
....in this ( https://help.talend.com/search/all?query=tRunJob). I think this describes most of what you need.