Clarity

  • 1.  Is there a way to get the ID of the job that started a process via 'Execute a Process'

    Posted Sep 11, 2017 03:04 PM

    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?



  • 2.  Re: Is there a way to get the ID of the job that started a process via 'Execute a Process'

    Posted Sep 11, 2017 04:21 PM

    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

     CMN_SCH_JOBS.JOB_DEFINITION_ID



  • 3.  Re: Is there a way to get the ID of the job that started a process via 'Execute a Process'

    Posted Sep 12, 2017 08:04 AM

    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.



  • 4.  Re: Is there a way to get the ID of the job that started a process via 'Execute a Process'

    Posted Sep 13, 2017 06:44 AM

    You can have a look at the job tables to see if you get further

    ERD for Jobs database entities