Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Amit4
Contributor III
Contributor III

How to get Master Job Name if Sub-job fails

Hi,

There are many master jobs which contains multiple sub-jobs. If any sub-job gets failed, we are not getting details about master job. If we can get the master job, then easily we can get the location of issue. Otherwise, we have to check manually. Please guide.

Thanks,

Amit

8 Replies
Anonymous
Not applicable

Hi

There is a global variable (jobName) that stores the current job name, you can pass the master job name to child job if you need to use the master job name in child job. eg:

0695b00000kVviGAAS.jpg 

// mainJobName is a context variable defined in child job, it will stores the master job name.

 

Regards

Shong​

Amit4
Contributor III
Contributor III
Author

Hi Shong,

This is my job in which I have three sub-jobs. After using the context parameters, it fails all the sub-jobs.

0695b00000kWHyuAAG.png

I have used the context parameters like this in the below screenshot in all the tables I have put the same Parameters = MasterJob and values = MainJob.

0695b00000kWI0lAAG.png 

And Declared the Master context in each child job. Even I created same context in Master Job as well.

 

0695b00000kWI1KAAW.png 

 

Please guide to finish it.

 

Thanks for your support and response.

 

Thanks,

Amit

Anonymous
Not applicable

the global variable's name is: jobName, so change the value from 'MainJob' to 'jobName' on tRunJob component.

Amit4
Contributor III
Contributor III
Author

Thanks Shong for clarifying. It worked for me.

I got the Master job Name through mail.

 

Can we get anyhow sub-job and master job both the names through the mail??

 

Please Guide!

Thanks

Anonymous
Not applicable

the global variable exists in each job, if you print the value of global variable in child job, you will get the child job's name.

 

Amit4
Contributor III
Contributor III
Author

Hi Shong,

Currently I have generated failure in third sub-job and getting the details for the failure through the mail.

Please check the below screenshots:

0695b00000kWPFnAAO.png

Failure details through mail:

0695b00000kWPFsAAO.pngIn this whether I am using Global variable or not. I am getting

job = MasterJobName only. I am not sub-job (EmpJoinDept) Name which I want to see. I tried to create a context storing sub-job name and calling through the mail, but I couldn't get the sub-job name. Only MasterJobName is coming. At the end I want to achieve both the master and sub-job Name in the mail..Hope it is clear now.

 

Please guide.

Thanks,

Amit

Anonymous
Not applicable

Hi

From your screenshots, I think understand what you expect, in this case, you are using tLogCatcher to catch the error and send an email in main job, the 'Origin' column tells you which component has the error, you can customize these information by linking tLogCatcher to a tMap, update the column's value or add extra columns, for example, add a new column in the output table, let's call it 'childJobName', and set its value as:

row1.Origin.equals("tRunJob_3")?"real_child_name3":(row1.Origin.equals("tRunJob_2")?"real_child_name2":"real_child_name1")

 

Hope it is clear!

 

Regards

Shong

JSpence1684138720
Contributor
Contributor

Thanks for the info, I appreciate you.