Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
gpinumalla
Creator
Creator

want to pass same batch_id for all jobs with timestamp start and end time.

Hi all,

I want to run 70 jobs some are sequential and some are independent but want to run in a batch . I wanted set same batchid from one job other 69 jobs but timestamps for start and end time will change. can this done in talend ? is this possible ? 

 

Labels (2)
3 Replies
Anonymous
Not applicable

Yes, this can be done. I'm not entirely sure of your environment and can only go on what you are telling me. However, the way I would achieve this would be to create a job that will run first for each batch. The task of this job would be to set the batch number, preferably in a database. Then each job in your batch will request the latest batch id at the beginning as well as logging the start time. Regarding start and stop times, a good way of doing this is to use tPreJob and tPostJob components in all of your jobs. The tPreJob runs before the main job code runs and the tPostJob runs at the very end. The cool thing about the tPostJob is that it ALWAYS runs, even if there is an error in the job.

gpinumalla
Creator
Creator
Author

It works fro adding batch_id in main job but when I am calling batch_id from sub jobs it fails and not able to retrieve the batch_id from sub jobs although  I gave the globalmap.put commnad in main job. 

 

Is there to ifx these in other way without context variables? 

 

 

Anonymous
Not applicable

Either pass the batch id to your tRunJobs using contexts or read it in using a db component. The globalMap is only available within a single job. You can pass its value to a child job (using a tRunJob), but only to a context variable.