search cancel

How to Reference ProcessID of Job in other objects


Article ID: 89869


Updated On:


CA Automic Workload Automation - Automation Engine


How to Reference ProcessID of Job in other objects


Release: AOATAM99000-9.0-Automic-One Automation Tools-Application Manager


Detailed Description and Symptoms

Jobs that run on Agents that integrate with Applications return a Application jobid as the 'ProcessID'

Sometimes this ID needs to be referenced in other Objects or Notifications.


?In the Post-Process Tab add the following script in an Include or straight into the Tab:


:set &pid#=prep_process_var(PROCESS.ID)
:process &pid#
: set &pid_nbr#=get_process_line(&pid#,1)
: p &pid_nbr#
:put_var PID_NBR.VAR,"pid.&$RUNID#",'&pid_nbr#', '&$PHYS_DATE_DDMMYY#'
:close_process &pid#


The Script references a SQLI Variable(PROCESS.ID). The statement in the variable would be:


select ah_processid from ah where ah_idnr=&$RUNID#


The Script then inserts the value into a Static Variable(PID_NBR.VAR) with the Key being pid.<runid>. The Variable can be referenced by an object later on.




To clean out the entries in the Static Variable, put the following Script in a Script Object and schedule it to run weekly/monthly/etc:

:set &pid#=prep_process_var(PROCESS.ID)
:process &pid#
:    set &pid_nbr#=get_process_line(&pid#,1)
:    set &date#=get_process_line(&pid#,3)
:    if &date# <> &$PHYS_DATE_DDMMYY#
:      delete_var "PROCESS.ID", "&pid_nbr#"
:    endif

:close_process &pid#