JR
asked on
How to schedule the quartz.net job that executes last working day every of two months
Hi Expert,
How to schedule the quartz.net job that executes last working day every of two months
Thanks,
JR
How to schedule the quartz.net job that executes last working day every of two months
Thanks,
JR
ASKER
On the schedule holiday should be considered.
Then you are not looking for a cron expression. A cron expression cannot factor in other date lookups and such. You will have to find an alternative implementation.
You can manage things by having the job reschedule itself if it fires on a holiday.
So your cron trigger can still run as intended, BUT if your Job it picks up that it is a holiday... it can create a new once-off schedule for itself to run on the next business day or something... OR at the end of run, you can check when the next scheduled run will be, see if it's a holiday. If it is a holiday, create a once-off schedule to run a day before... your cron-based job will still run as usual...
Something like that.
So your cron trigger can still run as intended, BUT if your Job it picks up that it is a holiday... it can create a new once-off schedule for itself to run on the next business day or something... OR at the end of run, you can check when the next scheduled run will be, see if it's a holiday. If it is a holiday, create a once-off schedule to run a day before... your cron-based job will still run as usual...
Something like that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can configure calendars in quartz.net via the ICalendar interface which comes with several default implementations... and it would then not fire of the holidays. But it would not do the rescheduling. It will just skip those days, which in your case, without the rescheduling, would result in quite a big gap.
0 0 15 LW 1/2 ?
The 15 is hours. So this cron will run in last weekday of every month at 3pm. I assume weekday=working day
The 1/2 is for month. Starting month 1, every 2 months.
Test it here : http://www.cronmaker.com