Script Function: Returns the status of an activated object.
GET_UC_OBJECT_STATUS([Object type ], [RunID], [ Request])
Syntax |
Description/Format |
---|---|
Object Type |
Short for of the object type. Optional parameter because the object type is clearly identified through its RunID (compatible with Version 2.6xx). |
RunID |
Run number of the activated object. |
Request |
Information that should be retrieved from the activated object. Allowed values: "STATUS" (default value), "RETCODE", "STATUS_TEXT" "RETCODE" = Retrieves the return
code of the activated object. |
Return codes |
---|
Depending on the specifications made, either
the return code, status or the status text of the task is returned. |
This script function can be used to retrieve information about the status of an executable object.
This script function even returns a value if the task is no longer active because this information is retrieved from the statistics. An empty string is returned if no statistical records are available.
All the parameters of this script function are optional. If you use only the parameter Request, ensure that two commas are set that replace the non-used parameters.
Example:
:SET &STATUS# = GET_UC_OBJECT_STATUS( ,,"STATUS")
If object type and RunID are not specified, the status of the task that uses this script function is returned.
If object type or RunID are not specified, the following peculiarities apply:
An empty string is returned if object type and RunID do not comply with each other. An empty string is also returned if no task could be found for the specified RunID.
If Request is not used, the script function returns the status code.
It is also possible to retrieve the status text for jobs. This is the text that was output by the Job Messenger in the Trailer or was modified with :MODIFY_STATE. Other object types return an empty string.
The first example activates the job "DB.USE" so that its status can be retrieved. An additional script function is used to retrieve the job's run number.
:SET &JNR#
= ACTIVATE_UC_OBJECT(JOBS,DB.USE)
:SET &STATUS# = GET_UC_OBJECT_STATUS(JOBS,&JNR#)
:PRINT "The status of the job(&JNR#) is &STATUS#".
The second example retrieves a task's own status. This status is output in the activation protocol.
:SET &RET# = GET_UC_OBJECT_STATUS()
:PRINT &RET#
In the third example, the script of a job should retrieve the workflow's (parent) status. Because two different object types are included, the workflow's object type and RunID must be assigned to the script function.
:SET &RUNNR# = SYS_ACT_PARENT_NR()
:SET &STATUS# = GET_UC_OBJECT_STATUS (JOBP,&RUNNR#)
:SEND_MSG
BU,BU,"The workflow's status is: &STATUS#."
The fourth example returns a job's status text.
:SET &RET# = GET_UC_OBJECT_STATUS(,,"STATUS_TEXT")
:PRINT &RET#
See also:
Script element | Description |
---|---|
Modifies a return code or status text of a job when it has finished. |
Script Elements - Activation Data
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function