Grails - getting job trigger values from a config file -
in grials application have job runs, , trigger defenition:
static triggers = { simple name: 'myjob', startdelay: 1000, repeatinterval: 36000000 } i change value shouln't hard coded, should taken congif/properties file.
i tried this:
config.groovy:
myjob { simplename = 'myjob' startdelay = '1000' repeatinterval = '36000000' } and in job trigger:
static triggers = { simple name: grailsapplication.config.myjob.name, startdelay: grailsapplication.config.myjob.startdelay, repeatinterval: grailsapplication.config.myjob.repeatinterval } but message saying: cannot reference nonstatic symbol 'grailsapplication' static context.
does have better idea how so?
thanks.
i have found problem , store properties in .properties file, remove triggers quartz job , manually bootstrap jobs in bootstrap.groovy getting values properties file.
check this: quartz plugin documentation see how trigger jobs
Comments
Post a Comment