Automic Workload Automation

  • 1.  How to find Activator ID by Script

    Posted Aug 07, 2017 06:01 AM
    Q: I want to send an email from a JOBS failing in a Workflow. This Email should contain the failed JOBS Runid and Name, determined with scripting.

    Answer: The following Script shows how to get the different Runids, Names and Types of Tasks:

    :s &NAME# = SYS_ACT_ME_NAME() :s &ID# = SYS_ACT_ME_NAME() :s &TYPE# = SYS_ACT_ME_TYPE() :p My Runid: &ID# Name: &NAME# Type: &TYPE# :s &NAME# = SYS_ACT_PARENT_NAME() :s &ID# = SYS_ACT_PARENT_NAME() :s &TYPE# = SYS_ACT_PARENT_TYPE() :p Processor Runid: &ID# Name: &NAME# Type: &TYPE# :s &NAME# = SYS_ACT_PARENT_NAME(ACT) :s &ID# = SYS_ACT_PARENT_NAME(ACT) :s &TYPE# = SYS_ACT_PARENT_TYPE(ACT) :p Activator Runid: &ID# Name: &NAME# Type: &TYPE#

    Processor Runid is the "container" of the task, group, workflow or schedule.
    Activator is either the Users session or the Activator Task.

    A List of all predefined Variables and corresponding Script Elements can be found here: https://docs.automic.com/documentation/webhelp/english/AWA/12.0/DOCU/12.0/AWA%20Guides/help.htm#AWA/Objects/varaPredefinedList.htm?Highlight=processor


  • 2.  How to find Activator ID by Script

    Posted Aug 07, 2017 08:38 AM
    I created a small INClude for some of my Jobs or workflows, possibly it helps:
    :PRINT "... entering JOBI.GENERIC.PRINT_PARENT ..."
    :PRINT "-------------------------------------------------------------------"
    :PRINT "ACTIVATOR: &$ACTIVATOR#   RUNID: &$ACTIVATOR_RUNID# "
    :PRINT "Activation Type: &$PARTNER_TYPE#    Obj Type: &$ACTIVATOR_TYPE#"
    :PRINT "PROCESSOR: &$PROCESSOR#   RUNID: &$PROCESSOR_RUNID# "
    :PRINT "PROCESSOR Type: &$PROCESSOR_TYPE#"
    :PRINT "Restarted: &$RESTARTED#"
    :PRINT "TOP WF: &$TOP_PROCESSFLOW_NAME#   RUNID: &$TOP_PROCESSFLOW_RUNID#"
    :PRINT "-------------------------------------------------------------------"
    :PRINT "... leaving JOBI.GENERIC.PRINT_PARENT ..."



    Report:
    2017-08-07 14:37:13 - U00020408 ... entering JOBI.GENERIC.PRINT_PARENT ...
    2017-08-07 14:37:13 - U00020408 -------------------------------------------------------------------
    2017-08-07 14:37:13 - U00020408 ACTIVATOR: JOBP.B_5   RUNID: 0001492124
    2017-08-07 14:37:13 - U00020408 Activation Type: D    Obj Type: JOBP
    2017-08-07 14:37:13 - U00020408 PROCESSOR: JOBP.B_5   RUNID: 0001492124
    2017-08-07 14:37:13 - U00020408 PROCESSOR Type: JOBP
    2017-08-07 14:37:13 - U00020408 Restarted: N
    2017-08-07 14:37:13 - U00020408 TOP WF: JOBP.B.4   RUNID: 0001492123
    2017-08-07 14:37:13 - U00020408 -------------------------------------------------------------------
    2017-08-07 14:37:13 - U00020408 ... leaving JOBI.GENERIC.PRINT_PARENT ...




  • 3.  How to find Activator ID by Script

    Posted Jan 16, 2018 07:49 AM
    Daniel_Trimmel_2011: The lines that fetch the run IDs are incorrect. Here is the corrected script with my changes in bold:
    :s &NAME# = SYS_ACT_ME_NAME() :s &ID# = SYS_ACT_ME_NR() :s &TYPE# = SYS_ACT_ME_TYPE() :p My Runid: &ID# Name: &NAME# Type: &TYPE# :s &NAME# = SYS_ACT_PARENT_NAME() :s &ID# = SYS_ACT_PARENT_NR() :s &TYPE# = SYS_ACT_PARENT_TYPE() :p Processor Runid: &ID# Name: &NAME# Type: &TYPE# :s &NAME# = SYS_ACT_PARENT_NAME(ACT) :s &ID# = SYS_ACT_PARENT_NR(ACT) :s &TYPE# = SYS_ACT_PARENT_TYPE(ACT) :p Activator Runid: &ID# Name: &NAME# Type: &TYPE#


  • 4.  How to find Activator ID by Script

    Posted Jan 16, 2018 12:12 PM
    In some use-cases I prefer SYS_ACT_RESTART_ME_NR over SYS_ACT_ME_NR.

    SYS_ACT_ME_NR retains the original runid of the object, even if you have restarted it.  Usually with our restarts, we want to know the runid of that restart, not the original runid.