From 30625a49405475b71309e84e3fe7de62f8e9213a Mon Sep 17 00:00:00 2001 From: lhameury <lukas.hameury@libriciel.coop> Date: Wed, 14 Feb 2024 10:26:14 +0100 Subject: [PATCH] Add new worker type (event) --- .../adullact/iparapheur/repo/worker/SchedulerService.java | 5 +++-- .../org/adullact/iparapheur/repo/worker/WorkerService.java | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/SchedulerService.java b/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/SchedulerService.java index c9654ec..2793a4c 100644 --- a/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/SchedulerService.java +++ b/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/SchedulerService.java @@ -102,8 +102,9 @@ public class SchedulerService extends AbstractLifecycleBean { public void selectWorker(Map request) throws JSONException { String type = (String) request.get(WorkerService.TYPE); DossierService.ACTION_DOSSIER action = DossierService.ACTION_DOSSIER.valueOf((String) request.get(ACTION)); - - if (WorkerService.TYPE_DOSSIER.equals(type) || WorkerService.TYPE_DOCUMENT.equals(type)) { + if(WorkerService.TYPE_EVENT.equals(type)) { + taskExecutor.submit(workerService.getHandler(request)); + } else if (WorkerService.TYPE_DOSSIER.equals(type) || WorkerService.TYPE_DOCUMENT.equals(type)) { String id = (String) request.get(WorkerService.ID); // (id == null) peut arriver pour les mails direct par exemple diff --git a/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/WorkerService.java b/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/WorkerService.java index 3e7d7e0..0b5d7ab 100644 --- a/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/WorkerService.java +++ b/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/WorkerService.java @@ -42,6 +42,7 @@ public interface WorkerService { String TYPE = "type"; String TYPE_DOSSIER = "dossier"; String TYPE_DOCUMENT = "document"; + String TYPE_EVENT = "event"; String TYPE_MAIL = "mail"; String WORKSPACE = "workspace://SpacesStore/"; String USERNAME = "username"; @@ -49,6 +50,9 @@ public interface WorkerService { String ACTION = "action"; String DOSSIER_CIBLE = "dossierCible"; String AUTOMATIC = "auto"; + String EVENT = "event"; + String PARENT = "parent"; + String OLD_PARENT = "old_parent"; /** * Returns a runnable which can handle the request passed in parameter. -- GitLab