To create a scheduled tasks you need to do the following things:
1. Create a java class that extends the SchedulerBaseTask (see example below)
2. Write your business logic
3. Compile and jar
4. Place the jar in the ScheduleTask directory in your OIM install
5. Create a new scheduled task using the OIM developer console
6. Link in the new class into your new scheduled task.
7. Done!
Example code for a scheduled task:
import com.thortech.xl.scheduler.tasks.SchedulerBaseTask; public class ScheduledtaskExample extends SchedulerBaseTask { public void init() { //this method is run before execute by the scheduler } public void execute() { //is executed by the scheduler runMyBusinessLogic(); } private void runMyBusinessLogic(){ //place your business logic here } public boolean stop() { //place logic that should run on a stop signal here } }
We also need stop() method for creating better Schedule Task.
ReplyDeleteGood point.
ReplyDeleteFixed now.