Complex scheduling problems

We love challenges and invite you to test us. Our timescheduling functionality is extremely powerful due to the possibility of and / or connection, which is why we ask our customers and partners to challenge us from time to time.

John’s Challenge:

“I want a job that usually runs on the 5th of every month to run only if it’s a working day. If the 5th falls on a public holiday or on the weekend, the job should run one day earlier. If this is also a day off, the job should run on the first working day after the 5th of the month.”

And here is the solution:

First of all, we need a definition of the Swiss working days, which on the one hand defines the working days Monday to Friday and at the same time contains a list of all public holidays and excludes them with the status “Inverse”. In the case of list entries without a year, the holiday always falls on the same date, entries with a year are variable holidays that must be maintained annually. We have named this calendar “WORKDAYS_CH”:

Figure 1: Definition of working days

Now two intervals are defined. The first interval contains the 4th and 5th of the month if these are working days:

Figure 2: In this interval, the 4th and 5th of the month are compared with the working days

The second interval contains the 5th and a few subsequent days of the month, provided they are working days in Switzerland:

Figure 3: The second interval compares the 5th and a few days after with the working days

In the next step, an interval JOHN_CHALLENGE_HLP is now defined, which supplies the last working day (if available) for the 4th and 5th and the first working day for the 5th and following

1. Dispatch Interval 5_OR_WORKDAY_BEFORE:

Figure 4: The cross defines that the latest possible day is selected in the first interval

2. Dispatch Interval 5_OR_WORKDAY_AFTER:

Figure 5: Here the cross specifies that the earliest possible date is selected in the second interval

Now we pack the above interval into the JOHN_CHALLANGE interval and select the 1st day from these days

Figure 6: The new interval JOHN_CHALLENGE

Now we have an interval definition that we can use in job schedules. The following screenshot shows the use in a schedule with the executions for the next 400 days.

Figure 7: The execution times within the next 400 days

Do you also have a challenge for us? We look forward to tricky tasks. Feel free to contact us!