Script functions reference > Script functions in alphabetical order > G > GetJobStatus

GetJobStatus
Syntax
GetJobStatus();
Description
Returns the status of the current job. This function is usually called from an After Process script. See also GetExtJobID, GetIntJobID, SetExtJobId.
Note:
You must enable Use Notifications in the Configure platform dialog. Otherwise this function will always return 1.
Returns
A number that indicates whether the job has been successfully completed.
num<>0
0
Example
//Get the external ID of the current job 
//and send the ID to the log
 
$jobid = getextjobid();
log (1, $jobid);
 
//Get the status of the current job. If an error has occurred,
//send an error message to the log.
 
$jobstatus = getjobstatus();
if ($jobstatus = "0")
    log (1, "An error has occurred");
 
//Get the internal ID of the current job 
//and send it to the log.
 
$intjobid = getintjobid();
log(1, $intjobid);
Result:
The external ID of the current job is written to the log with the log level of 1. If the job was not completed successfully, an error message is written to the log. Finally, the internal ID of the current job is written to the log.
OpenText StreamServe 5.6 Updated: 2013-03-01