Automic Workload Automation

  • 1.  Check if a task has already been started and launch it if it has not

    Posted Oct 04, 2016 07:57 AM
    These 3 script functions allow you to verify if a task or a workflow is already active:
    Let's say I want to start my workflow JOBP.COMMUNITY if it's not already running. It would look like this:
    :IF SYS_STATE_ACTIVE(JOBP.COMMUNITY)= 'N'
    :  SET &ACT# = ACTIVATE_UC_OBJECT(JOBP.COMMUNITY)
    :ENDIF



  • 2.  Check if a task has already been started and launch it if it has not

    Posted Oct 04, 2016 10:24 AM
    I'd add to the above the use of SYS_ACTIVE_COUNT as it has additional capabilities and in some cases can be more selective.


  • 3.  Check if a task has already been started and launch it if it has not

    Posted Oct 11, 2016 05:07 AM
    Antoine_Sauteron, - Hi Antoine, you advised this post was created to follow for the issue we had when our scheduler object didn't reload at turn round time. This was found to be due to an issue we had with the server where the AE database is located. When the issue was resolved and the scheduler object loaded later than its normal time and therefore a number of workflows missed their start times "ENDED_TIMEOUT - Start time exceeded" - this meant a number of high priority workflows didn't execute - spotted later and ran manually fortunately.
    I think it is unlikely to occur again (fingers crossed) - However, if it does is there someway we could possibly reset the scheduler object to mitigate workflows missing their start times?
    I have no scripting experience so would possible require some assistance in using a script to check if the scheduler object was late reloading 


  • 4.  Check if a task has already been started and launch it if it has not

    Posted Oct 14, 2016 06:23 AM

    Hi IanFindon611036 ,

    Being able to change the start time of a task within a schedule would imply that this task is an attribute of the schedule that could be modified with scripting.

    However this is not the case. As far as I know, you may check if the schedule has already been started, but not dynamically change the start time of the tasks that it contains.

    So a solution could be to create an TIME EVENT object that would periodically check if the JSCH is already started, and if not:

    •  Start the JSCH
    •  Instantly trigger all the tasks contained in the JSCH with ACTIVATE_UC_OBJECT to make up for the failed runs


    It could look like this:


    :IF SYS_STATE_ACTIVE(JSCH.FAILED)= 'N'
    : SET &ACT# = ACTIVATE_UC_OBJECT(JSCH.NORMAL)
    : SET &ACT1# = ACTIVATE_UC_OBJECT(TASK1.FAILED)
    : SET &ACT2# = ACTIVATE_UC_OBJECT(TASK2.FAILED)
    ...
    :SET &ACTN# = ACTIVATE_UC_OBJECT(TASKN.FAILED)
    :ENDIF

    Of course, This is only one possibility. As always there are probably other and better options.

    Best regards,
    Antoine