Quartz Plugin

Unable to create customTrigger

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.4.1
  • Fix Version/s: 0.4.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Grails-1.1, OSX 10.5, Java 1.6

Description

This block in TriggersConfigBuilder.groovy

Is trying to create an Expando instance with 2 maps instead of the supported one meaning a customTrigger can never be created.

} else if (name == 'customTrigger') {
            trigger = new Expando(
                    clazz: attributes?.triggerClass,
                    attributes
            )
            if (!trigger.clazz) throw new Exception("Custom trigger must have 'triggerClass' attribute")
            if (!Trigger.isAssignableFrom(trigger.clazz)) throw new Exception("Custom trigger class must implement org.quartz.Trigger interface.")
}

i.e.

new Expando([clazz: attributes?.triggerClass] + attributes)

Activity

Hide
Stan Carney added a comment -

Here is the Exception groovy kicks out:

Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: groovy.util.Expando(java.util.LinkedHashMap, java.util.LinkedHashMap)

Here is an example the trigger I was trying to create:

static triggers = {
    customTrigger triggerClass: CronTrigger, name: "Submitter", group: "file", cronExpression: "0 */1 * ? * MON-FRI", timeZone: TimeZone.getTimeZone("EST5EDT")
}

In case you are wondering why I didn't just use the cronTrigger. I couldn't figure out a way to specify a timezone.

Show
Stan Carney added a comment - Here is the Exception groovy kicks out:
Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: groovy.util.Expando(java.util.LinkedHashMap, java.util.LinkedHashMap)
Here is an example the trigger I was trying to create:
static triggers = {
    customTrigger triggerClass: CronTrigger, name: "Submitter", group: "file", cronExpression: "0 */1 * ? * MON-FRI", timeZone: TimeZone.getTimeZone("EST5EDT")
}
In case you are wondering why I didn't just use the cronTrigger. I couldn't figure out a way to specify a timezone.
Hide
Sergey Nebolsin added a comment -

Scheduling with custom trigger is fixed now.

Also added timeZone parameter for the cronTrigger.

Show
Sergey Nebolsin added a comment - Scheduling with custom trigger is fixed now. Also added timeZone parameter for the cronTrigger.
Hide
jorge added a comment -

Hi,
is TriggersConfigBuilder.groovy update into zip file ?
If you unzip and compare both files almost there is one different at :

else if(name == 'customTrigger') {
if(!attributes?.triggerClass) throw new Exception("Custom trigger must have 'triggerClass' attribute")

Perhaps is necessary update all files after unzip ?
Thanks

Show
jorge added a comment - Hi, is TriggersConfigBuilder.groovy update into zip file ? If you unzip and compare both files almost there is one different at : else if(name == 'customTrigger') { if(!attributes?.triggerClass) throw new Exception("Custom trigger must have 'triggerClass' attribute") Perhaps is necessary update all files after unzip ? Thanks

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: