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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Use a parameter as jobname in a tRunJob component

Is it possible to use a global variable or a context variable as jobname in a tRunJob component?
If yes, how?
What I want to do is to have a list of jobs in a file and to execute them sequentially.
Thanks
Didier
Labels (2)
8 Replies
Anonymous
Not applicable
Author

Hi Didier,
"Use dynamic job " option allow multiple Jobs to be called and processed.
Please refer to the scenario "Running a list of child Jobs dynamically" from component reference:TalendHelpCenter:tRunJob
Best regards
Sabrina
Anonymous
Not applicable
Author

Thanks Sabrina,
So I have looked the help page and modified my job

0683p000009MCx2.png
0683p000009MCzX.png
but currently I have the following erreor:
Démarrage du job PMI_Schedule a 10:52 21/01/2016.
connecting to socket on port 3630
connected
Exception in component tFlowToIterate_1
job1|Q
job2|M
java.lang.NullPointerException
    at pmi.pmi_schedule_0_1.PMI_Schedule.tFileInputExcel_1Process(PMI_Schedule.java:1495)
    at pmi.pmi_schedule_0_1.PMI_Schedule.runJobInTOS(PMI_Schedule.java:2196)
    at pmi.pmi_schedule_0_1.PMI_Schedule.main(PMI_Schedule.java:2024)
disconnected
Job PMI_Schedule terminé à 10:52 21/01/2016.

why?
As you can see I can displyed the data:
job1|Q
job2|M
Where is the problem?
Thanks
Didier
Anonymous
Not applicable
Author

Hi,
You are using "If" connection type between tflowtoiterate and tRunjob. What's the condition?
It seems that ((String)globalMap.get("log.Nom_du_job")) doesn't receive any value.
Best regards
Sabrina
Anonymous
Not applicable
Author

below the condition:
(String)globalMap.get("frequence").equals("Q")||((String)globalMap.get("frequence").equals("M")&&TalendDate.getFirstDayOfMonth(TalendDate.getCurrentDate())==TalendDate.getCurrentDate())
Anonymous
Not applicable
Author

Hi,
Have you tried to use "iterate" row without this condition to see if your job works?
Best regards
Sabrina
Anonymous
Not applicable
Author

with iterate:
Démarrage du job PMI_Schedule a 11:37 21/01/2016.
connecting to socket on port 3612
connected
Exception in component tRunJob_2
java.lang.RuntimeException: The child job named null is not in the job list.
    at pmi.pmi_schedule_0_1.PMI_Schedule.tFileInputExcel_1Process(PMI_Schedule.java:1617)
    at pmi.pmi_schedule_0_1.PMI_Schedule.runJobInTOS(PMI_Schedule.java:2230)
    at pmi.pmi_schedule_0_1.PMI_Schedule.main(PMI_Schedule.java:2058)
disconnected
Job PMI_Schedule terminé à 11:38 21/01/2016.

0683p000009MCrF.png
Anonymous
Not applicable
Author

below the screenshot of the debug session:

0683p000009MCeB.png
Anonymous
Not applicable
Author

I have done many tests and it does not work
I think that my ((String)globalMap.get("Nom_du_job")) is empty in the tRunJob component:

0683p000009MD1r.png
the global variable Nom_du_job should be defined in the tFlowToIterate component ???
Could you tell me where I am wrong?
Thanks
Didier