Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Scheduler

Avatar

Level 4

Is it possible to update SCHEDULER CRON EXPRESSION value dynamically, with a value coming from an AEM component dialog ? Please help....!

 

My scenario: I need to send email and sms reminders to webinar subscribers 1 hour before the webinar starts, there will be a webinar scheduled every week and scheduler should run at that time, scheduler cron expression should be updated automatically when a time is authored for a webinar in the component.

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

you can use Job manager to schedule and unschedule jobs

https://redquark.org/aem/day-18-sling-jobs/ 



Arun Patidar

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

you can use Job manager to schedule and unschedule jobs

https://redquark.org/aem/day-18-sling-jobs/ 



Arun Patidar

Avatar

Level 2

You can try to access and modify osgi config for scheduler while you are authoring your component. You can either provide cron expression through authoring or make a list of pre defined cron expression and select any out of the list on the basis of auhoring value.

 

As you will commit the value in osgi config, scheduler will be configured with @MODIFIED annotation.

Avatar

Employee Advisor

Hi,

 

I don't think that it should be done this way. Instead I would have the scheduler hourly and check if email needs to be sent (by checking all webinars which are not already happened). Or you could use a scheduled job as mentioned by @arunpatidar , which is probably the best way to handle this.