Tuesday, 15 July 2014

Grails Quartz dynamic scheduling Import issue -



Grails Quartz dynamic scheduling Import issue -

i want utilize dynamic scheduling feature of grails quartz plugin.

i running grails 2.3.5 , quartz plugin (quartz:1.0.2).

i able persist quartz info mysql database , able run normal quartz jobs.

the problem scheduling tasks dynamically. not getting work.

here setup , trying do:

i have simple job in "grails-app/tao/marketing/marketingjob" looks this:

package tao.marketing import org.quartz.jobexecutioncontext; import org.quartz.jobexecutionexception; class marketingjob { static triggers ={} def execute(jobexecutioncontext context) { try{ def today = new date() println today } grab (throwable e) { throw new jobexecutionexception(e.getmessage(), e); } } }

which seek schedule dynamically service.

package tao import grails.transaction.transactional import tao.marketing.campaignschedule import tao.person import jobs.tao.marketing.* class scheduleservice { def schedulemarketingforperson(campaignschedule campaignschedule, person person) { log.info("schedule new marketing for: "+person.last_name) campaignschedule.scheduleactions.each { date today = new date(); date scheduledate = today+it.afterxdays log.info("scheduleaction: "+it.id+": "+scheduledate) marketingjob.schedule(scheduledate, ["scheduleactions.id":it.id, "person.apikey":person.apikey]) } } }

in ide (sts) marketingjob cannot found.

marketingjob.schedule(scheduledate, ["scheduleactions.id":it.id, "person.apikey":person.apikey])

how correctly import marking job? understand dynamic scheduling feature correctly?

could job in "package tao.marketing" , import "import jobs.tao.marketing.*"? mean, import starts "jobs"

grails quartz-scheduler grails-plugin jobs

No comments:

Post a Comment