Hello Dear Red,
To write your own job …
- you have to go to your module folder in which you want this job.
I am amusing you are in your module folder.
follow the below given path
src → main → java → com → (create a folder with any name ) → job
create new file as .java and write you job here in .java file
src → main → java → com → (create a folder with any name ) → service
create new file as .java and write you service here in .java file
here is an example of my job
package com.alzaproperty.apps.platter.job;
import com.alzaproperty.apps.platter.service.unheld_platters.UnHeldPlatterService;
import com.axelor.exception.AxelorException;
import com.google.inject.Inject;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class UpdatePlatterStatusJob implements Job {
@Inject protected UnHeldPlatterService unHeldPlatterService;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
try {
unHeldPlatterService.updatePlatterStatus();
} catch (AxelorException e) {
throw new JobExecutionException(e);
}
}
}
and the you can write your service cording to your work.
Hope you understand ?