ESP dSeries Workload Automation

 View Only
  • 1.  Need javascript solution for odd scheduling requirements

    Posted May 06, 2021 11:42 AM
    We have the following scheduling scenarios requested, we have tried to code some javascript but it is not working for us. Anyone out there know of a solution or had to schedule something similar

    Job 1

    Schedule on 1st workday of Month at 17:00 GMT & Schedule on 20th Day to last workday of month at 17:00 GMT

     

    if (today('1st workday of month')) APPL.RUNME ='true';

    if (daysFrom('20th day of month') >= 0 && daysTo('last workday of month') <= 0) APPL.RUNME ='true';      (doesn't work from 21st day through last workday)

    else APPL.RUNME ='false';


    Job 2

    Schedule Daily at 11:00 GMT. DO Not Schedule on 1st WorkDay and 2nd WorkDay of every month & Schedule on 1st WorkDay  if it falls on Friday (only)

    if (today('1st workday of month plus 0 workdays')) APPL.RUNME = 'false';

    if (today('1st workday of month plus 1 workdays')) APPL.RUNME = 'false';

    else  if (today('1st workday of month' == 'friday')) APPL.RUNME = 'true';        (This contradicts on something on occasion)

    else APPL.RUNME = 'true';



  • 2.  RE: Need javascript solution for odd scheduling requirements

    Broadcom Employee
    Posted May 20, 2021 09:31 AM
    Hi,

    For criteria 1 , can you try the below javascript and see if it works

    if (today('1st workday of month'))
    {
    APPL.RUNME ='true';
    }
    else
    if (daysFrom('20th day of this month') >= 0 && daysTo('last workday of this month') >= 0)
    {
    APPL.RUNME ='true';
    }
    else APPL.RUNME ='false';


  • 3.  RE: Need javascript solution for odd scheduling requirements

    Broadcom Employee
    Posted May 21, 2021 07:20 AM
    For second scenario - 
    genTime('last','1st workday of month');
    APPL.day=lastDAY;
    APPL.RUNME = 'true';
    if (today('1st workday of month plus 0 workdays') && lastDAY !='Friday')
    APPL.RUNME = 'false';
    else
    {
    if (today('1st workday of month plus 1 workdays'))
    APPL.RUNME = 'false';
    }


  • 4.  RE: Need javascript solution for odd scheduling requirements

    Posted May 24, 2021 09:48 AM
    is there a reason you are not using the run / do not run statements