tags:

views:

134

answers:

1

I'm planning to have a view that presents a button so that when it is clicked, it will run a Quartz job and the page will finish loading successfully (no need to wait for the job to finish). Based on this documentation, you can have a custom trigger class. Can you help me implementing it?

My job:

class ReconciliationJob {
    static triggers = {
        custom name:'customTrigger', triggerClass:ReconciliationTrigger, targetDate:myValue
    }


    def execute() {
        // execute task
    }
}

How can I implement ReconciliationTrigger class? Also, I need to pass a parameter to the job too.

Thanks.

+2  A: 

I think you've mixed up jobs and queues.

Quartz jobs are background tasks which run on a time-based trigger and are not designed to be kicked off by user-driven events.

Queues, such as JMS, allow you to send an asynchronous 'message' (method call) in the manner you describe. Take a look at the Grails JMS plugin and it might be what you're looking for.

Dave
thanks for that info. indeed, i'm not aware of the concept of queues or the messaging structure in grails until now. will look into it more. but feel free to provide the solution while i'm familiarizing myself w/ JMS
firnnauriel
And you can feel free to post the solution when you've worked it out :-)
Dave