cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduled job run id

0 Kudos

Hi,

I would like to log the job id of each scheduled job execution for correlation/troubleshooting purposes. Do xsjob scheduled jobs have any id that can be retrieved from a HANA project (e.g. xsjs file)? If not is there any mechanism for setting/getting a job ID?

Thanks,

Diego

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Yes every job instances has a job ID. When you add a new Job via the XSJS API, you receive this job id:

http://help.sap.com/hana/SAP_HANA_XS_JavaScript_Reference_en/$.jobs.JobSchedules.html

If you create it manually in the XSAdmin tool, you don't see the Job ID in the UI. However the Job ID can be read from the table "_SYS_XS"."JOB_SCHEDULES". 

I think though that you are asking if you can read the Job ID from within the logic being executed by the JOB?  Is that correct?  If so there is no public API where you could do that. I suppose you could read it from the above mentioned table by hard coding the Job Name in the query.

0 Kudos

Yes, I would like to retrieve the job id from the xsjs program that the job triggers. If there is no public API, is there any way that the xsjob itself could pass the id as a "parameter" to the xsjs program?

0 Kudos

Thomas, I'm curious, is the job ID stored in the database identifying the job (definition) or there is one id for each execution/run of that job?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It is per job definition not per job run for a reoccurring job.

Answers (0)