Automic Workload Automation

  • 1.  GET_UC_OBJECT_NR() function behavior

    Posted Sep 05, 2014 05:52 PM
    Just sharing an observation. 

    I am using the GET_UC_OBJECT_NR() function in a script to pull the runid of a parallel task.  But if the parallel task fails and is restarted without first deactivating the failed run, this function will always return the runid from the failed run.  So I have modified the target object to "always deactivate" to simplify recovery.

    Pete


  • 2.  GET_UC_OBJECT_NR() function behavior

    Posted Sep 08, 2014 01:45 PM
    That function does have the following comment for OM V8 and I'm guessing that is what you are encountering.
    If the object has been activated more than once, the oldest RunID is returned.
    I'm assuming that the script logic that is using the GET_UC_OBJECT_NR() function is not in the actual object that has failed and is restarted but by some other object.

    When we have to deal with this issue we will sometimes have the object update a Variable that contains the needed RunID(s).  That way other objects can have access to the task's run and restart RunIDs.  Something like the following is normally placed in the Pre Process.
    :SET &me_runid = SYS_ACT_ME_NR() :PRINT "RunID is &me_runid" :IF SYS_ACT_RESTART() = "Y" : SET &me_re_runid = SYS_ACT_RESTART_ME_NR() : PRINT " and the restart RunID is &me_re_runid" : ENDIF ! Store RunID in a Variable object as needed.
    We normally use Deactivate Always but this also works for all deactivation values.  This works reliably for us whether the object is executed as a single task in a flow or concurrently (parallel).


  • 3.  GET_UC_OBJECT_NR() function behavior

    Posted Sep 08, 2014 01:59 PM
    Stuffing it into a variable also protects against "what if" the job finishes too quickly for the script to see it in the Activity window.  Thanks!

    Pete


  • 4.  GET_UC_OBJECT_NR() function behavior

    Posted Sep 08, 2014 03:58 PM
    I've always wanted something like a PREP_PROCESS_STATISTICS function.  It would return a data sequence of all of the RunIDs for the named object.  You could then use the GET_STATISTIC_DETAIL function on each returned line.  Something like this (obviously not tested):
    :SET &me_name = SYS_ACT_ME_NAME() :SET &pid = PREP_PROCESS_STATISTICS(&me_name) :PROCESS &pid : SET &me_runid = GET_PROCESS_LINE(&pid) : SET &the_end = GET_STATISTIC_DETAIL(&me_runid,END_TIME) : PRINT "&me_name(&me_runid) ended at &the_end" : ENDPROCESS :CLOSE_PROCESS &pid
    Perhaps I'll make a product suggestion.