[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Creating a weekly Schedule  XML
Forum Index -> Quartz
Author Message
umesh261

neo

Joined: 10/02/2013 23:33:52
Messages: 5
Offline

Hi,

I am trying to create a weekly Schedule with the following requirements,

1. On specific day of the week
2. Run every specified interval
3. At specific hour and minutes of the day.

eg. Run every 3rd monday at 23:59 .

Can you please help me with this .

Help needed urgently
kraiss

journeyman

Joined: 09/17/2013 06:32:19
Messages: 14
Offline

Take a look at this tuto :
http://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger

And this doc :
http://quartz-scheduler.org/api/2.2.0/org/quartz/CronExpression.html
[WWW]
umesh261

neo

Joined: 10/02/2013 23:33:52
Messages: 5
Offline

Hi,

thanks for the reply.

With Cron Expression I can schedule a weekly schedule which runs at every monday on particular time.

But i cannot run it bi-weekly.

./Umesh
kraiss

journeyman

Joined: 09/17/2013 06:32:19
Messages: 14
Offline

Cron expression will allow you to choose specific and consistent schedule like :
- "3rd monday at 23:59 of every month" => "0 59 23 ? * 2#3"
- "1st and 3rd monday at 23:59 of every month" => "0 59 23 ? * 2#1,2#3"
- "1st monday and 3rd fridayof every 2 months every minute between 12:00 and 13:00 " => "0 * 12 ? 1,3,5,7,9,11 2#1,6#3"

If you want to set a interval in weeks you can use the CalendarIntervalScheduleBuilder but it won't remain consistent from a year to another :
http://www.quartz-scheduler.org/api/2.2.0/org/quartz/CalendarIntervalScheduleBuilder.html

Btw, don't forget that you can schedule a Job with multiple Triggers. See
http://www.quartz-scheduler.org/api/2.2.0/org/quartz/Scheduler.html#scheduleJob(org.quartz.JobDetail, java.util.Set, boolean)
[WWW]
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team