Automic Workload Automation

 View Only
  • 1.  Skipping a particular cyclic run from Event

    Posted Aug 08, 2019 11:47 AM
    Hi,

    We have a scenario / requirement

    a job is running every 10 mins from 8AM to 11AM, application team wants that only 8:30AM run to skip rest shd run as per schedule. Means all runs starting from 8:00, 8:10, 8:20, ..... , 8:40, 8:50 shd run just skip 8:30 AM run

    so is there  a way in Automic to implement this scenario.


    in other tools we can put an exception entry which will skip the run for that entry but same i dont see in Automic.

    Any pointers or help is highly apperciated.


  • 2.  RE: Skipping a particular cyclic run from Event
    Best Answer

    Posted Aug 08, 2019 01:55 PM
    Edited by Diane Craddock Aug 20, 2019 11:56 AM
    One option is to use a script like this;

    :set &TimeToSkip# = "0830"
    :if &TimeToSkip# = "&$PHYS_TIME_HHMM#"
    : print "Not executing due to &TimeToSkip# skip rule."
    : stop NOMSG
    :endif

    Another option is to instead of using an automated repeat rule, install a different run schedule for each instance that needs to run.  This provides two benefits;  (1) they show up on forecast reports and (2) you can customize your skip-run rules with calendar features too (e.g. skip at 0830 only on saturdays)  The latter can be done with scripting too.

    ------------------------------
    Pete (AE V11.2)
    ------------------------------



  • 3.  RE: Skipping a particular cyclic run from Event

    Posted Aug 09, 2019 06:30 AM
    Hi,
    Solution to test time can be risky if your schedule of the task starts at 08:29 or 08:31.

    Try to test if time is greater than 08:25 and less than 08:35 so it should be the 08:30 theorical run that is executing this command.

    You can also, if you use an event object to activate the job, create two separate event. One running from 08:00 every 10 minutes and ending at 08:25 (runtime options or test time and cancel with ended_ok status if time > 08:25. Second event object starts at 08:40 until 11:00.

    Another option is to define time period for event activation from 08:00 to 08:25 and from 08:40 till 11:00. But check how it is reacting for the next run calculation if you need to be right on 08:40 for the run of the job. This setting is in the "Time and Date Conditions" section of the "Time Event" view of the Event Object in v12 or in the "Calendar" tab in versions < 12.

    As usual there is multiple solutions to a problem and you just need to select the one you are the most comfortable with and that fit your requirements.

    Alain


  • 4.  RE: Skipping a particular cyclic run from Event

    Posted Aug 13, 2019 10:22 PM

    Hi Sunish,

    What I am failing to understand is the "Why" skip the 0830 instance of a 10 minute job. What we have done is use a JOBI which checks the previous instance of the JOBP that is being activated, and if it is still active, we skip. This will solve the 2 instances running at the same time regardless of the source of the active instance. Here are the contents of the JOBI and all you have to do is put this JOBI call in the !Process tab of the event that launches it and define the JOBP name in the event Variable tab:
    ! **Common JOBI to check previous instance of JOBP before running another**
    ! **The object that calls this JOBI will need JOBP=FlowName-
    ! defined in the Variable Tab of the event definition.**
    :SET &RunID = GET_UC_OBJECT_NR(&JOBP)
    :SET &STATUS_VARS = GET_UC_OBJECT_STATUS(JOBP, &RunID)
    :PRINT "STATUS of &JOBP is &STATUS_VARS"
    : IF &STATUS_VARS NE 1550 OR 1560
    : SET &ACT=ACTIVATE_UC_OBJECT(&JOBP)
    : PRINT "Previous instance not active in PROD, launching another"
    : ELSE
    : PRINT "Previous instance still active in PROD, not launching another"
    : ENDIF

    [[[  KR, Brian ​V11.2.0  ]]]



    ------------------------------
    Founder and Partner
    Data Center Automation Consultants DCAC
    ------------------------------



  • 5.  RE: Skipping a particular cyclic run from Event

    Posted Aug 13, 2019 11:29 PM
    I see two options.  Set up four options.  1) set up two time events.  One runs from 8:00 to 8:20.  The second runs from 8:40 - end.  2) set up three entries in the schedule for the 8:00, 8:10 and 8:20 runs and then set up the time event to start at 8:40 - end. 3) Keep the one time event and have it kick off another event that evaluates the interval.  if it does not = 8:30 then run, else end.  4) Put the time event in its own queue.  Then set up two scripts that will pause the queue at 8:25 and the second will unpause the queue at 8:35.  By pausing the queue, the time event will not be able to kick off the process.

    There may be other ideas, but that is what I came up with in a few minutes.  Although I must say I like Pete's idea as you do not have to add any more objects to the mix, unless you go the schedule route.

    Good Luck.

    Cheers,
    Gary Chismar