ACTIVATE_UC_OBJECT

Use the ACTIVATE_UC_OBJECT function to execute an object through a script. You can activate any type of executable object with this function. Parameters in the function let you define when the object executes, and which variables are passed to the object.

This function includes several parameters that let you define start times. If you do not specify a start time, the new task is immediately launched into the execution queue. If you define a start time, the task is scheduled and has the status Waiting for start time. You can also activate the object at a logical date, or specify an alternative object to activate when the called object exceeds a time limit.

This script function returns the RunID of the called object. Parameters on the Attributes page of the object determine whether the RunID is returned after the activation or generation phase:

More information:

Notes

Syntax

ACTIVATE_UC_OBJECT ( Object name [ , , [Logical Date] [ , [TimeZone] [ , [ Start time|Period object] [ , [ PASS_VALUES] [ , [Queue] [ , [Alias] [ , [ENABLE_PROMPTS] ] ] ] ] ] ] ])
ACTIVATE_UC_OBJECT ( Object name [ , [WAIT] [ , [Logical Date] [ , [TimeZone] [ , , [ PASS_VALUES] [ , [Queue] [ , [Alias] [ , [ENABLE_PROMPTS[, FixedTimeValue, [TERMINATE][, Executed-Object] ] ] ] ] ] ] ] ] ])

Note: You must write the parameters of this script function in the order shown above. Set commas if you omit parameters.

Parameters

More Information:

Return Codes

The ACTIVATE_UC_OBJECT script function returns the following return codes:

Tip: Always query the return code in your scripts so that you can analyze error causes. For more information, see Error Handling in Scripts

The script function returns the RunID of the object in the following situations:

The script function returns 0 in the following situations:

The object attribute Generate Task at Runtime or Activation has an impact on return codes. For more information, see Generating at Activation or at Runtime.

If the object is configured to be generated at activation, the script function returns the RunID of the object in the following situations:

The script function returns 0 in the following situations:

If the object is configured to be generated at runtime, then script execution does not take place during the activation process. The ACTIVATE_UC_OBJECT script function cannot identify errors that occur. The function returns the RunID in the following cases:

Examples

The following example activates a Job called Status, checks the return code, and sends an email with the error code and error message if the job fails to activate:

:SET &ACTOBJ# = ACTIVATE_UC_OBJECT(STATUS)

:
IF &ACTOBJ# = "0"
:   
SET &ERRNR# = SYS_LAST_ERR_NR()
:   
SET &ERRINS#  = SYS_LAST_ERR_INS()
:   
SET &MESSAGE# = GET_MSG_TXT(&ERRNR#,&ERRINS#)
:   
SET &RET# = SEND_MAIL("john.smith@automic.com",,&MESSAGE#, "Please check. Thank you!")
:
ENDIF

The following example activates the Job with a logical date:

:SET &ACTOBJ# = ACTIVATE_UC_OBJECT(STATUS,,"DD.MM.YY:01.12.15"

In the following example, the Workflow object MM.WEEK runs at a specific date and time:

:SET &ACTOBJ# = ACTIVATE_UC_OBJECT(MM.WEEK,,, "MEZ", "2018-07-15 18:00:00")

In the following example, object variables are inherited by the Job MM.END.PROCESSING:

:SET &ACTOBJ# = ACTIVATE_UC_OBJECT("MM.END.PROCESSING",,,,, PASS_VALUES)

See also:

seealso

Script Elements for Handling Tasks