[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]
How to add trigger without scheduling a job  XML
Forum Index -> Quartz
Author Message
clarky

neo

Joined: 01/31/2012 10:11:45
Messages: 2
Offline

When I add a cron trigger to a job like so:

Scheduler.ScheduleJob(trigger);

it runs the job immediately rather than waiting for the scheduled time.

Is there a way to create triggers on a job that will only run at the time stipulated by the Cron expression and not before?

Thanks
Bermudo

neo

Joined: 03/05/2010 22:34:35
Messages: 7
Location: Modena, Italy; Berlin, Germany; Madrid, Spain
Offline

Well, if the job fires immediately then that's what your cron expression indicates.

If you want to start it at a later date or time, you can set a start time for a trigger. See the documentation of the TriggerBuilder.
clarky

neo

Joined: 01/31/2012 10:11:45
Messages: 2
Offline


The Cron expression is
0 32 8 ? * MON-FRI

i.e Fire at 8.32am Mon-Fri

Job attached to this trigger always fires when the trigger is added.
It happen for each of the 110 jobs in my schedule regardless of the Cron expression(obviously each one is different)
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline



set the startTime property to something that's not in the past.
Bermudo

neo

Joined: 03/05/2010 22:34:35
Messages: 7
Location: Modena, Italy; Berlin, Germany; Madrid, Spain
Offline


The cron expression by itself is correct. How are you loading the job into the scheduler?
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team