I've currently got this Cron expression that I'm using to trigger a process in UiPath Orchestrator:
0 0 15 21W * ? *
Runs on the closest working day to the 21st of each month at 3pm.
However I need it to run on the next working day at 3pm if the 21st is a non working day.
Tried searching for an answer and nothing quite fit the brief.
I used this website to build my expression (which is a great tool) but it only had an option for 'nearest day' and not next working day given a specific day of month: https://www.freeformatter.com/cron-expression-generator-quartz.html
As you don't need the nearest day, you can't use the functionality of Orchestrator cronjob. I would recommend creating a wrapper process as follows:
StartJobByCheckingDate
StartJobByCheckingDate
each day at 3pmDataTable
or even a file
in the StartJobByCheckingDate
process, that contains all the different days where your desired process should be fired (but this is very manual, you might not want to update this every year, so this might not be the smartest but the easiest solution)true
: you could now create a empty dummy file somewhere that tracks that the 21th was a non-working day, and the next day you check that file existing, if it exists you check the current day to be a working day, and if so you delete the file again and start your desired processfalse
: just start your desired process directlyI think 2. idea would be that best. Sure you have 365 jobs runs/year. But when you keep that helper process smart this will just be seconds.
Another idea instead of using the dummy file, would be to use Entities. Smarter but need some more time to get familiar with.
the W does work but as stated this is the 'nearest' working day. So for example if the test hit Saturday then Friday would be the closest...it needs to be the 'next' working day and not 'nearest' i.e. in my example it would need to run on Monday.
Ahh, now I got your issue. Okay. Well and just having multiple cronjobs for each day maybe? But you don't want the manual work right? Another idea would be to check in the process if it is the next or previous day. Another idea would be that you create an application on your own that starts a job. This is possible with the Orchestrator control. But I have a even better idea where you can stay in the low-code universe. I will edit answer.
Yeah that could work and pretty sure there are some datetime functions that could be used to determine working days like you said. Not ideal but marked as a solution regardless...It's a shame cron can't do it :(
Please test it and come back when it does not work for you, I'm interested if it works for you. :)