ESP Workload Automation

 View Only
  • 1.  Wait X time if other application finished within the last 6 minutes

    Posted Sep 10, 2019 02:47 PM

    I have a user asking me the following:

    Do you have examples of ESP applications that wait a specified amount of time for other ESP applications to complete before the original application runs?

    Specifically what I'm trying to do is make sure application A and B never run within 6 minutes of one another. So, when application A starts, it checks for the last completion of B. If B has run within the last 6 minutes, A waits 6 minutes past the completion of B before it actually runs. The same type of logic would be put in B to check for A's completion.


    I do not have any examples of this, so I am reaching out to the communities to see who has code for this.

    Thanks,

    Frank



  • 2.  RE: Wait X time if other application finished within the last 6 minutes

    Broadcom Employee
    Posted Sep 11, 2019 08:32 AM
    Hi Frank,

    I suggest that you use APPLSTART & APPLEND in both APPL A & B, as well as global variable:

    APPLSTART WAIT
    /* retrieve the time when the jobs can run*/
    VGET NEXTRUNTIME TABLE(WAIT)
    DELAYSUB %NEXTRUNTIME
    ENDJOB

    ....
    APPLEND RESET
    /* generate the time for 6 minutes later*/
    GENTIME RR REALNOW PLUS 6 MINUTES 
    /* set variable value to be the time of 6 minutes later*/
    VSET NEXTRUNTIME %RRTIME TABLE(WAIT)
    ENDJOB

    Hope this helps,

    Lucy


  • 3.  RE: Wait X time if other application finished within the last 6 minutes

    Posted Sep 13, 2019 10:17 AM
    Thank you, I have forwarded this on to the user and will let you know the end result once implemented.


  • 4.  RE: Wait X time if other application finished within the last 6 minutes

    Posted Sep 11, 2019 10:42 AM
    Frank ... if you need to ensure that the events don't run within 6 minutes of each other ... why not have the last step of the event trigger the next iterations with a 6 min delay ...  if that does not work ... use resourse to to control execusion and have the the last step be a selfcompleting task that toggles your resource 6 mins after all the jobs end (using a ENDJOB WOB with a reldelay of 6 works here to know when the last job runs you can run a link process after it).