UiPath Orchestrator Triggers - Cron Expression For specific day of month or next working day if not a working day - date

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:
Create a new process, let's call it StartJobByCheckingDate
Now create a trigger that starts StartJobByCheckingDate each day at 3pm
So that process is now your manager of your desired process
Now we need to check if it is the 21th day
Here you have different ways to solve it
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)
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.

We have (had) the exact same issue. Since UiPath doesn't offer a feasible solution out of the box, we will work around the restriction using the following strategy: We trigger the actual job daily, considering a custom-built, static NonWorkingDay-list that will just suppress the execution of the robot every day we don't want it to run.
These steps are needed:
Get a list with of all known bank holidays, saturdays and sundays until 2053 or so...
Build a the static exclusion-list using a script that does something like this (pseudocode. I will update the answer once we have actually implemented the solution):
1. get all valid execution dates
loop through every 28th of the month until end of 2053
if the date is in the bankHolidayList then
loop until the next bankDay is found
add it to the list of valid ExecutionDates
else
add the date to the validExecutionDate-list
2. build exclusion-list
loop through every day until end of 2053
if the date is not in the validExecutionDate-list
add it to the exclusionDate-list
Format the csv accordingly and upload it to the orchestrator tenant as a NonWorkingDay-List
Update your trigger to run daily at your desired time, using the uploaded NonWorkDay-Calendar
While the accepted answer will surely work as well, we prefered to go with this approach because having a separate robot that does nothing but executing a UiPath trigger just doesn't seem right to me. With this approach we have no additional code that we potentially need to maintain.
In my oppinion not having a solution for this concern out of the box is a lack of feature that UiPath will (hopefully) fix until end of 2053 ;-)
Cheers

You can configure your trigger to launch oftener, then manage dates at init of your process, but you must set up a list of "holydays" or check in some way.
Also you can use the calendar option of orchestrator (+info)

Related

In Azure devops, how to query task that was not close in the same day it was activated/ when the state was changed?

Im a bit new at azure devops and I am trying to view task that was not close in the same day it was activated/ when its state was changed using query. My point of confusion is that I dont know how compare the state change date with the close date.
the output should be tasks that are still active and task that are closed but not in the same date it state was change
UPDATE
So I was wondering if my approach was wrong so I tried different approach.
here I try using the []<> to compare completed date with activation date, it should have sorted to show only task that the activation date are different from the close date but here I still got shown tasks which have close date and activation date in the same date.
UPDATE 2
Since I cant use the '[]<>', I decided to use the not so smart way to compare the task close date, active date, and create date as seen in the screenshot below, it is ugly but it works. If anyone knows a smarter way to do this, please do tell.
My current solution
I still got shown tasks which have close date and activation date in the same date.
The reason for this problem you met is that when you use the condition “Closed Date <>[Field] Activated Date”, the values of these two fields are actually datetime format which means it contains hours, minutes and seconds like below:
That’s why you can still see the records shown with same date.
As for the requirement you mentioned, there’s no directly available solution you can use in Azure DevOps Query as far as I know.
In addition, please refer to Group clauses where you can see how to set conditions for “not close in the same day it was activated/ when its state was changed”, like below:

What is the most reliable way to schedule a job with cron scheduler is Quartz that repeats every N days starting from a specific date

In our app, we have an ability to schedule tasks and we converting this functionality to Quartz. One of the problems that I have is scheduling recurring task that should run, for example, every third day.
The cron expression that I had in mind first of all is:
0 37 18 */3 * ? *
But what this will do, is execute that job on 1,4,7, etc... Which is fine, assuming that I want to start from the first day of the month. However, how to deal with this issue if I need to start from 11th?
I could do something like this:
0 37 18 11/3 * ? *
But, in this case, I will always miss all the days before the 11th.
Also, when the time comes for the next month, the expectation that the day of the month will now be different (on one month the job executed on 1st, and on another it could be on 2/3), but based on the cron above it will restart on the same day (e.g. 1st).
I could, of course, count using hours, but then I will have an issue with day light saving?
What is the correct way to organize it? Or am I missing something?
UPDATE
Possible solution is to use simple trigger, as per http://www.quartz-scheduler.org/documentation/quartz-2.1.x/cookbook/BiDailyTrigger.
But in this case, how do I resolve DST problem?
Thanks,

Scheduling a job to run every Nth week and specific week days starting on specific date with Quartz (Scala)

In continuation of:
What is the most reliable way to schedule a job with cron scheduler is Quartz that repeats every N days starting from a specific date
&
Absolutely unexplainable results for cron based scheduler in Quartz
There is another question regarding possibilities of scheduling with quartz. And the difference between the two above and this one and the fact that I am trying to execute more than a single job for the target period (e.g. Mon, Fri every 4th week)
Let's assume that a user needs to execute a task every 4th week on Wednesday & Friday starting from a specific date.
Of course, I can setup a cron scheduler that will look something like this:
0 0 12 ? 1/4 WED,FRI *
But we are beck to the same problem as described in the linked posts. What this cron expression really mean, is execute the job on Wednesday & Friday of every 4th week of the month.
Another option is to use, calendar interval schedule builder (the perfectly resolves the problem for as long as there is only one day of the week that needs to be considered); however, it does not allow to specify days of a week, but simply calculates the true 4 weeks worth of time based on the start date.
How, if possible, to schedule a job with Quartz, that will be executed every 4th (or any Nth week) on more than a single day of the week? Is it possible to achieve it without multiple triggers?
Thanks,
So, after long digging around, it seems like the only way to solve it with existing Quartz tools is to manage this type of scheduling with more that one trigger (one for every weekday).
Hopefully that helps somebody.

Google Script Run ClockTrigger Multiple Scripts

The situation I have is this:
a google form signup where people can sign up for notifications
a series of scripts that I would like to run nightly that looks through the form responses and emails people appropriately, Emailer()
an unsubscribe script that ideally runs frequently (every hour or so would be enough) as well as right before the notifications email is
sent. This looks through the inbox for emails and removes the
appropriate entries from the form responses, Unsubscriber()
I am having trouble coming up with a way to coordinate the way these two scripts will run. What I would like to happen is to have Unsubscriber() run every hour or so throughout the day. At midnight or some late night hour, I would like to run Emailer() once and have the Unsubscriber() function not be running at this time. Once Emailer() completes, I would like the Unsubscriber() function to resume running at its regular interval. I feel like this should be possible using a ClockTrigger, but I can't envision how to make it happen.
I am also wondering, if the Unsubscriber() function is scheduled to run every hour with a ClockTrigger, but takes longer than an hour on a certain instance, will the ClockTrigger start a second instance of the script?
Here is the documentation on how to create manually a time trigger, you can set the function to run every hour.
This trigger could be related to a main function in which you could evaluate the current time, if its in the range of midnight (e.g. 12am < current time > 1am) call the function Emailer(), for every other time of the day call Unsuscriber().
Hope this helps.

Exclude time blocks on particular day [Quartz Schedular]

I am using Quart Scheduler. I want to trigger to in such a fashion so as it excludes timing from xx:xx:xx to yy:yy:yy on day specified (monday, friday. sunday). I know how to exclude particular day. but don't know how not to trigger on given time block on given day?
Can anybody know anything about it?
Please make use of Calendar and HolidayCalendar available in Quartz to achieve this. The Cron expression in Cron-Trigger can also be written smartly to achieve this as well.
Looking at http://www.quartz-scheduler.org/docs/examples/Example3.html, it seems that one can create different job set to do the same task. For each job one can attach a schedule.
If you dont want to run a particular task on say sunday between 1pm and 10pm, but want it to run on sunday the remainder of the day, then you can create two jobs [set to do the same task]. For one give the schedule with time restrictions 00:00 to 13:00. And for the second give time restriction of 22:00 to 23:59.
I hope I understood your problem correctly ...