Automic Workload Automation

 View Only

 No workflow modifications allowed because not in an active status error message when the workflow IS active

Mylene Chalut's profile image
Mylene Chalut posted Nov 29, 2021 02:24 PM

Hello guys !

I've been trying to modify the start time of a task within a workflow.  I created a script object to do so, and added it to be executed just before the task.  Here is the script :

!! GET PARENT OBJECT ID
:SET &PARENTID# = SYS_ACT_PARENT_NR()
:SET &PARENTNAME# = SYS_ACT_PARENT_NAME()
:PRINT &PARENTID#
:PRINT &PARENTNAME#
:PRINT &JOB_ACT_DATE#
:PRINT &$PHYS_DATE_YYYYMMDD#

!! COMPARE PARENT ACTIVATION DATE ASSIGNED IN JOBI.BR_GET_GENERIC_VARIABLES WITH ACTUAL DATE
:IF &JOB_ACT_DATE# > &$PHYS_DATE_YYYYMMDD#
:  print "Execution of JOBS.WIN.BR_SI_SURVEY.PROC_EXPORT.DAILY.STATS.TO.SQLTABLE delayed until next day"
:ELSE
:  SET &ACTIVE# = SYS_STATE_JP_ACTIVE(&PARENTNAME#)
:  PRINT &ACTIVE#
:  print "Execution of JOBS.WIN.BR_SI_SURVEY.PROC_EXPORT.DAILY.STATS.TO.SQLTABLE will start now."
:  SET &RETCODE# = MODIFY_UC_OBJECT(&PARENTID#, EARLIEST_STARTTIME, "JOBS.WIN.BR_SI_SURVEY.PROC_EXPORT.DAILY.STATS.TO.SQLTABLE","OFF")
:ENDIF

As you can see, I added some code to validate that my workflow was indeed active before modifying the task property (Earliest Start Time).  However, when I execute the workflow, I get the following message:  Workflow 'JOBP.WIN.BR_UTILITY_EXPORT.DAILY.STATS.TO.SQLTABLE' (RunID: '0024050289') is not in an active status - no modifications allowed.  Here is the content of my script's ACT report:

2021-11-29 13:30:47 - U00020206 Variable '&JOB_ACT_DATE#' was stored with value '20211129'.
2021-11-29 13:30:47 - U00020408 0024050289
2021-11-29 13:30:47 - U00020408 JOBP.WIN.BR_UTILITY_EXPORT.DAILY.STATS.TO.SQLTABLE
2021-11-29 13:30:47 - U00020408 20211129
2021-11-29 13:30:47 - U00020408 20211129
2021-11-29 13:30:47 - U00020408 Y
2021-11-29 13:30:47 - U00020408 Execution of JOBS.WIN.BR_SI_SURVEY.PROC_EXPORT.DAILY.STATS.TO.SQLTABLE will start now.
2021-11-29 13:30:47 - U00011112 Workflow 'JOBP.WIN.BR_UTILITY_EXPORT.DAILY.STATS.TO.SQLTABLE' (RunID: '0024050289') is not in an active status - no modifications allowed.


All of the objects (JOBP, JOBS and SCRI) have been setup to get generated at activation time.

Can somebody help me with this ? Has any of you experienced the same situation ?

Thanks in advance for your help :-)

Mylene

Pete Wirfs's profile image
Pete Wirfs

Did you follow this instruction?

NoteIf you use the EARLIEST_STARTTIME attribute, you must specify the RunID of the workflow to which the task belongs and not the RunID of the task.

Pete Wirfs's profile image
Pete Wirfs
We use MODIFY_TASK() to lengthen MRT settings at month-end, but I've never used MODIFY_UC_OBJECT().
Pete Wirfs's profile image
Pete Wirfs
Would it be possible to not use earliest-starttime, but use a VARA that is populated with a timestamp and checked periodically by a task precondition rule?
Mylene Chalut's profile image
Mylene Chalut
​​The script had to be set to be generated at runtime.  Everything is running as expected now ;-)