One Star

Using jobname in the job

Hi,
I am using the following expression in tmap -
(String)globalMap.get("jobName")
to tlogrow, but this is coming as null. I want to capture the jobname and write it to a table along with other fields.
Thanks,
Vishu
3 REPLIES
One Star

Re: Using jobname in the job

Hi Vishal,
Try using just the keyword in the Expression Builder.
This should help you. Smiley Happy
MathurM
One Star

Re: Using jobname in the job

Thanks! MathurM
Can you help me with another question? I need to pass the jobName from parent job to child job.
Thanks,
Vishhu
One Star

Re: Using jobname in the job

Hi Vishhu,
If you already defined a context variable with the name 'jobName' in your parent job and child jobs then you can simply pass the same parameter in tRunJob component.
Please not that it is not necessary to have the same variable name in both the jobs such as parent and child.Define your own context variable like below and configure accordingly in tRunJob component.
Define context  :

configuration in tRunJob component :


Please see the difference in context variable names in parent and child jobs.
In parent job : jobName
In child job : job_name
If you want to transmit all the context variables from parent to child job then use the 'Transmit whole context' option, so that you don't need to define them all in the parameters section.
Hope that helps.