Implement Scheduler in Liferay 6.1

3 comments
Many times we want our logic to be executed at certain Date/Time .Liferay 6.X comes with in built capability of scheduler. Here is the example which can help you ..!!
1) Make below entry in Liferay-portlet.xml

Following cron expression indicates that the scheduler will run every day at 18:00 PM.

To know how to write cron expression you can visit below links.
Cron Trigger
Cron Maker

2) create scheduler class.



Next PostNewer Post Previous PostOlder Post Home

3 comments:

  1. Along with the basics,the links are pretty resourceful

    ReplyDelete
  2. Good to know that it helped you . Please follow this blog to get more updates.

    Thank you
    Jitendra Rajput

    ReplyDelete
  3. So I have all of this setup and working, but now I am trying to getNextFireTime displayed in my console. This works great IF my scheduler has run. Currently, I have it set to run every 10 minutes. So after a new code deployment or after a server restart, the scheduler has not run and I cannot retrieve the nextFireTime. Is there a way to call this class from another class, as to force the scheduler to run?

    ReplyDelete