views:

134

answers:

2

I have nested task to schedule:

(1). A daily master task downloading scheduling information, which is a List of job names with timestamps (2). schedule the job in the scheduling information I just downloaded according to its timestamp

I am not sure how the nested jobs work in Quartz. It seems that I need a CronTrigger triggering a job, which contains multiple SimpleTriggered jobs. Are there any way to do that? Are there any alternatives?

Thanks. Lily

A: 

You basically need to run Quartz inside of your Quartz job. This doesn't really make sense, why don't your just run all of the jobs with Quartz configurations? I don't think this nesting is a good idea.

stevedbrown
I am not quite get u... How can I do that?
Lily
+1  A: 

They aren't really nested jobs.

You are correct in that the master job needs a CronTrigger. But when that job runs it will cycle through the list of jobs downloaded creating a job and a SimpleTrigger for each entry. You can get a Scheduler from the CronJob's JobExecutionContext and add the jobs to it.

And bingo, all your jobs are scheduled.

Jon Strayer
very helpful and it really works! Thank you so much for your answer!
Lily
I'm glad to help.
Jon Strayer