I am executing a scheduled process using the 'Execute a Process' and need to determine the ID of the job that submitted the process. Is there a table that ties the process instance id to the job id?
For MS SQL you could try
SELECT CMN_SCH_JOBS.[NAME] , NULL run_ID --, ISNULL(convert(varchar,run_id ),'') ,CMN_SCH_JOBS.[ID] job_id -- ,[JOB_DEFINITION_ID] J_DEF_ID ,convert(varchar,getdate(),21) Time_now ,CMN_SCH_JOBS.[START_DATE] ,CMN_SCH_JOBS.[END_DATE] , NULL Exce_time_s , NULL pcnt_compl --,[SCHEDULE_DATE] ,CMN_SCH_JOBS.[STATUS_CODE] ,(cmn_sec_users.last_name + ', ' + cmn_sec_users.first_name) RUNNER
FROM [niku].[CMN_SCH_JOBS], cmn_sec_users where cmn_sch_jobs.LAST_UPDATED_BY = cmn_sec_users.id and CMN_SCH_JOBS.[STATUS_CODE] NOT IN ('PAUSED','SCHEDULED')
ORDER BY START_DATE DESC
If you want to limit that to Execute process see the ID in
This gives me a list of all of the jobs that were executed but does not guarantee that I get the correct job id. If the same job is executed multiple times at the same time (multiple instances are allowed) they all have the same start_date (and time). I can get around this by not allowing multiple instances to occur at the same time but didn't want to have to do that. I was looking for a table(s) that tied the gel_processInstanceId to the job_id that executed the process.
You can have a look at the job tables to see if you get further
ERD for Jobs database entities
Retrieving data ...