Warm tip: This article is reproduced from serverfault.com, please click

UiPath Orchestrator Triggers

发布于 2020-11-20 15:44:50

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

Questioner
Scott
Viewed
0
kwoxer 2021-03-01 04:18:50

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:

  1. Create a new process, let's call it StartJobByCheckingDate
  2. Now create a trigger that starts StartJobByCheckingDate each day at 3pm
  3. So that process is now your manager of your desired process
  4. Now we need to check if it is the 21th day
  5. Here you have different ways to solve it
    1. You could create a DataTable 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)
    2. The other idea is to check if the current day is the 21th day. If so check if it is Saturday/Sunday (non-working day).
      • If 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 process
      • If false: just start your desired process directly

I 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.