GET_UC_OBJECT_STATUS

Use the GET_UC_OBJECT_STATUS script function to retrieve the status of an activated object.

Syntax

GET_UC_OBJECT_STATUS ([Object type,] [RunID] [, Request])

Parameters

All parameters are optional. If you do not specify values for Object Type or RunID, set two commas before the Request parameter.

Example: :SET &STATUS# = GET_UC_OBJECT_STATUS( ,,"STATUS")

Return Codes

The possible return codes depend on the parameters that you define.

The script function returns the status of the task that the script is in when you define the parameters as follows:

To return the status of a different task, specify the RunID of the desired task. If the task is of a different type than the task that contains the script, specify the object type.

The script function returns an empty string in the following situations:

Note: The script function returns a value even if the task is no longer active, because the information is retrieved from the statistics.

Examples

The following example activates a Job (DB.USE). The script retrieves the status of the Job, and prints the status and RunID in the activation report.

: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 following example retrieves the status of the task that contains the script. The script prints the status in the activation report.

:SET &RET# = GET_UC_OBJECT_STATUS()
:
PRINT &RET#

The following script is in a Job that is a part of a Workflow. The script retrieves the status of the Workflow.The parameters of GET_UC_OBJECT_STATUS specify the object type and RunID of the Workflow because the Job and Workflow are different object types. The script sends a message to a particular user (Jane in the Engineering department) to inform them of the status of the Workflow.

:SET &RUNNR# = SYS_ACT_PARENT_NR()
:
SET &STATUS# = GET_UC_OBJECT_STATUS (JOBP,&RUNNR#)
:
SEND_MSG JANE,ENGINEERING,"The status of the workflow is &STATUS#."

The following example returns the status text of a Job.

:SET &RET# = GET_UC_OBJECT_STATUS(,,"STATUS_TEXT")
:
PRINT &RET#

See also:

seealso

Script Elements for Handling Tasks