AutoSys Workload Automation

  • 1.  Javascript Question

    Posted Jun 28, 2018 10:58 AM

    Hello guru's! I would like to know if there is an easier way to script a javascript variable to say "between the hours of 7 a.m. and 11 a.m."? Here is what I have and it is working but I wondered if there is easier way to code it. I've tried many different variations of IF with >=, <= and was unsuccessful. What worked is this statement with a bunch of "OR's".

     

    APPL.RUNME7AM='FALSE';
    if (APPL._SHH == '07' || APPL._SHH == '08' || APPL._SHH == '09' || APPL._SHH == '10' || APPL._SHH == '11') APPL.RUNME7AM='TRUE';



  • 2.  Re: Javascript Question
    Best Answer

    Posted Jul 02, 2018 01:20 PM

    i saw a different post with something similar

     

    This works on WOB if application is triggered after 07:00 and before 17:00, the job would wait until 17:00 to run.  I would think something similar should work for what you are doing.

    %IF((APPL._SHH > '07') && (APPL._SHH < '17'),'17:00')

     

    %IF((APPL._SHH > '07') && (APPL._SHH < '11'))

     



  • 3.  Re: Javascript Question

    Posted Jul 06, 2018 07:14 AM

    Thanks this is a much cleaner line of code than what I had.



  • 4.  Re: Javascript Question

    Posted Jul 04, 2018 09:48 PM

    Hi Kenneth,

    Did Sharon's response help? If so, please mark as correct, else let us know if you need further help.

     

    Thanks,

    Chandru



  • 5.  Re: Javascript Question

    Posted Jul 06, 2018 07:02 AM

    Sorry for the delay I was out of the office on vacation. I will be posting my results today.