Posts

Showing posts with the label Camunda 8 Service Task

Camunda 8 – Service Task avec Java

 Dans Camunda 8 , les Service Tasks ne sont plus exĂ©cutĂ©es de manière embarquĂ©e comme dans Camunda 7. Elles sont traitĂ©es par des Job Workers externes , ce qui permet une architecture cloud-native, scalable et dĂ©couplĂ©e . Avec Spring Boot , l’annotation @JobWorker est la manière la plus simple et la plus propre d’implĂ©menter un Service Task en Java. 🔹 1. Principe de fonctionnement Dans Camunda 8 : Un Service Task BPMN crĂ©e un Job Le Job est identifiĂ© par un type Un Job Worker Java s’abonne Ă  ce type Le worker exĂ©cute la logique mĂ©tier et met Ă  jour les variables 👉 Le type du Service Task dans le BPMN doit correspondre exactement au type dĂ©fini dans @JobWorker . 🔹 2. Configuration du Service Task dans BPMN Dans Camunda Modeler : Ajouter un Service Task Implementation : Job Worker Type : payment-worker (exemple) (Optionnel) Retries : 3 📌 Ce type sera utilisĂ© cĂ´tĂ© Java. 🔹 3. DĂ©pendance Maven (Spring Boot) < dependency > ...

Camunda 8 Service Task with Java

 In Camunda 8, a Service Task is executed by a Job Worker (external worker). In Spring Boot, the easiest way to implement this is with @JobWorker , where the job type (a.k.a. task type) in the BPMN matches the worker’s type . This blog shows a complete working example: BPMN service task → Java worker → update variables → handle failures . 1) BPMN: Configure the Service Task (Job Type) In Camunda Modeler: Add a Service Task Set Implementation to Job Worker (or “External” depending on Modeler version) Set Type to: payment-worker (example) (Optional) Set Retries : 3 Important: The Type must match the Java worker annotation: @JobWorker(type = "payment-worker") 2) Spring Boot Dependencies (Maven) Use Camunda 8 Spring Boot starter (Zeebe): < dependency > < groupId >io.camunda </ groupId > < artifactId >spring-boot-starter-camunda </ artifactId > </ dependency > If you’re using an older setup, you may see io...