Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top