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.
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.
Along with the basics,the links are pretty resourceful
ReplyDeleteGood to know that it helped you . Please follow this blog to get more updates.
ReplyDeleteThank you
Jitendra Rajput
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