BATCH : Alerte date fin de contrat

Bonjour à tous !

Tout nouveau sur Axelor, tout d’abord un grand merci pour cet ERP ;).

J’aimerai pouvoir recevoir un e-mail contenant la liste de tous les contrats qui arrivent à expiration dans 3 mois.

Pourriez-vous svp, m’éclairer et m’expliquer comment créer ce rappel ?

  1. J’ai compris que je devais activer le " Quartz Scheduler " (chose faite)
  2. Je vais dans le Planificateurs, et la ça me demande de choisir un Job, mais je ne trouve nulle part la possibilité de créer un Job perso ?

La création de ce genre de Job / Rappel se fait facilement ?

Merci par avance :wink:

1 J'aime

I created a similar job to remind Timesheet deadline and to reming change psw and block account invalidating psw

Hi Fabiobottan,

Thank’s you for your help, but, could you explain me how i can create a Job ?
(or where i could find step by step ?)

Hello Dear Red,
To write your own job …

  1. 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 ?

1 J'aime

best way is to use gist to share code matters

2 J'aime

hi could you solve this?
I can share my code step by step. if you need.

Hello,

Thanks you for your help.

Could you explain Step by step with your shared code ?

I have some diffcults to find it:(.

Best regards

1 J'aime

Hello
If you want to configure a job to run automatically see my code snippet.

https://bitbucket.org/fbottan/workspace/snippets/LzobAb

See attached image of the configuration.

Job scheduling guide from Axelor official docs
https://docs.axelor.com/adk/5.2/dev-guide/modules/scheduler.html

1 J'aime

Hello !

Did my example work for you?