Script statement kicks off before ACTIVATE_UC_OBJECT finishes
search cancel

Script statement kicks off before ACTIVATE_UC_OBJECT finishes

book

Article ID: 226620

calendar_today

Updated On:

Products

CA Automic Operations Manager

Issue/Introduction

When using the following script, SCRI.TEST:

:p "start time is&$PHYS_TIME_HH#"
:SET &ACTJOB# = ACTIVATE_UC_OBJECT("SCRI.WAIT.10")
:p "end time is &$PHYS_TIME_HH#"

where SCRI.WAIT.10 has:
:wait 10
:P "script time is :&$PHYS_TIME_HH#"

The Script time shows 10 seconds after the end time from the original script.

Expected behavior for reports:

SCRI.TEST should show:

2021-10-21 02:53:07 - U00020408 start time is 02:53:07
2021-10-21 02:53:17 - U00007000 'SCRI.SLEEP.10' activated with RunID '0001157008'.
2021-10-21 02:53:17 - U00020408 end time is 02:53:07

SCRI.WAIT.10 should show:

2021-10-21 02:53:17 - U00020408 script time is 02:53:07

Actual behavior for reports:

SCRI.TEST shows:

2021-10-21 02:55:12 - U00020408 start time is 02:55:12
2021-10-21 02:55:12 - U00007000 'SCRI.WAIT.10' activated with RunID '0001158007'.
2021-10-21 02:55:12 - U00020408 end time is 02:55:12

SCRI.WAIT.10 should show:

2021-10-21 02:55:22 - U00020408 script time is 02:55:12

Environment

Release : 12.2

Component :

Cause

This is as designed based on the parameters for activate_uc_object

Resolution

This can be resolved by using a WAIT parameter in the ACTIVATE_UC_OBJECT function and that will cause the third command to wait until the second (activate_uc_object) command is fully finished.  This would look like:

:SET &ACTJOB# = ACTIVATE_UC_OBJECT("SCRI.WAIT.10", WAIT)

Additional Information

More info can be found here: https://docs.automic.com/documentation/webhelp/english/AA/12.3/DOCU/12.3/Automic%20Automation%20Guides/help.htm#Script/Reference/ACTIVATE_UC_OBJECT.htm?Highlight=WAIT
The same documentation can be found by right-clicking on activate_uc_object in the Process tab, choose "Search in Help" from the context menu