Last year I wrote a scheduler for running jobs in portal. A month later I found out that KM already provides a very good api for scheduling jobs which can run periodically. You can write any kind of job that can be executed via JAVA.Please don’t think the job only runs for KM stuff. I am currently using this scheduler task to extract BW data in xml format and store it in KM. So, in this weblog i am going to present a help guide for creating KM’s scheduler task for running jobs periodically.
The following steps will guide you in creating KM’s scheduler task for Portal
- Create an empty project
- Using the KM Scheduler Task Wizard, create a empty template for your job.
- Click on Next
- Fill out the above screen and click on Finish.
- Navigate in your project structure (under src.api folder) to find you java class file extract.java or whatever you have defined the class name in the wizard. You will find the following template already created by NWDS.
- Modify the code to do whatever task you want the class to perform. In my case i am going to grab a yahoo’s world news rss feed and store it in KM.
- Build your component and deploy your par and then navigate to following location.
System Administration->System Configuration->Knowledge Management->Configuration->Content Management->Global Services->Scheduler Tasks
- You will see your task. Click on it and schedule it to run at a particular time. You can define new periodic times as well.
Select the time you want to schedule and then click on Apply and OK. In my case i am runing it 50 minutes past every hour