Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
mr_burns
Contributor
Contributor

tRunJob - how to get name of child job?

Hi,

I have a child job called MyFirstChildJob.

I used a tRunJob component to run this child job and afterwards to send an e-mail:

 

tRunJob --> OnComponentOK --> tSendMail

 

Inside the tSendmail component I want to get the name of the child job (MyFirstChildJob) and show it inside the the subject and/or body of the e-mail.

But I don't know how to do it - how please can I get the name of the child job inside the tSendMail component?

 

Thanks...

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi
There is a global variable that stores the job name, you can use it directly. What you need to do is passing the job name from child job to the main job and store it to a context variable for used on tSendMail.
in the main jojb, define one context variable with string type, let's call it child_jobname.
tRunJob--main--tJavaRow
|onsubjobok
tSendMail
on tRunJob: define the same schema as tBufferOutput which is used in child job.
on tJavaRow:
context.child_jobname=input_row.job_name;

in child job:
tfixedFlowInput--main--tBufferOutput

on tFixedFlowInput: define one column with string type, set its value with global variable: jobName

Hope it helps you!

Regards
Shong

View solution in original post

1 Reply
Anonymous
Not applicable

Hi
There is a global variable that stores the job name, you can use it directly. What you need to do is passing the job name from child job to the main job and store it to a context variable for used on tSendMail.
in the main jojb, define one context variable with string type, let's call it child_jobname.
tRunJob--main--tJavaRow
|onsubjobok
tSendMail
on tRunJob: define the same schema as tBufferOutput which is used in child job.
on tJavaRow:
context.child_jobname=input_row.job_name;

in child job:
tfixedFlowInput--main--tBufferOutput

on tFixedFlowInput: define one column with string type, set its value with global variable: jobName

Hope it helps you!

Regards
Shong