Using jobname in the job

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
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.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download