Get status task (GS) extended agents only
About this task
The GS task tells the extended agent's method to check the status of a job. This is necessary when another job is dependent on the successful completion of an external job. Before running the method, the GSuser parameter is read from the method options file to determine the user account with which to run the method. If the parameter is not present or the options file does not exist, on UNIX the root user is used, and, on Windows, the user name of the account in which HCL Workload Automation was installed is used. If the method cannot be run, the dependent job or job stream is not allowed to run. If a jobid is available from a prior GS task, it is passed to the method.
The method checks the state of the specified job, and returns it in a %CJ message written to stdout. It then exits with an exit code of zero. At a rate set by the bm check status local option, the method is re-run with a GS task until one of the following job states is returned:
- abend
- The job ended abnormally.
- succ
- The job completed successfully.
- cancl
- The job was cancelled.
- done
- The job is ended, but its success or failure is not known.
- fail
- The job could not be run.
- error
- An error occurred in the method while checking job status.
- extrn
- The job check failed or the job status could not be determined.
Note that GStimeout in the method options file specifies how long HCL Workload Automation will wait for a response before killing the method. See Method options file for more information.
Task | Method Response | HCL Workload Automation Action |
---|---|---|
GS | %CJ state [jobid] | Sets job state to state and includes jobid in any subsequent GS task. |
%UT [errormessage] and Exit code=2 | Job state is unchanged. |
A method that does not support the GS task writes a %UT message to stdout and exits with an exit code of 2.