Posts

Showing posts with the label Work Item Handler

jBPM – Work Item Handler personnalisĂ©

 đź’ˇ Introduction Dans les systèmes d’entreprise modernes, il est frĂ©quent de devoir exĂ©cuter une logique spĂ©cifique — comme envoyer un e-mail, appeler une API REST, Ă©crire dans une base de donnĂ©es ou se connecter Ă  des applications externes. Avec đź§© jBPM , cela est possible grâce aux Work Item Handlers personnalisĂ©s (WIH) — des composants Java rĂ©utilisables qui exĂ©cutent une logique spĂ©cifique lorsqu’une tâche de service BPMN est dĂ©clenchĂ©e. Dans cet article, nous allons apprendre Ă  crĂ©er, enregistrer et utiliser un Work Item Handler personnalisĂ© dans jBPM , Ă©tape par Ă©tape. đź§  1️⃣ Qu’est-ce qu’un Work Item Handler ? Un Work Item Handler est une classe Java qui dĂ©finit la logique exĂ©cutĂ©e lorsqu’une tâche de service (Service Task) est appelĂ©e dans un processus BPMN. Chaque handler implĂ©mente l’interface : org.kie.api.runtime.process.WorkItemHandler Elle contient deux mĂ©thodes : executeWorkItem(WorkItem workItem, WorkItemManager manager) → exĂ©cute votre logique. a...

jBPM CustomWorkItemHandler

 đź’ˇ Introduction In real-world business workflows, you often need to perform custom operations—like sending emails, invoking APIs, writing to databases, or integrating with external systems. jBPM makes this possible through đź§© Work Item Handlers (WIHs) — reusable Java components that execute custom logic in your process. In this tutorial, you’ll learn how to create, register, and use a custom Work Item Handler in jBPM from scratch. đź§  1️⃣ What is a Work Item Handler? A Work Item Handler is a Java class that executes custom logic when a Service Task in your BPMN process is triggered. Each handler implements the interface: org.kie.api.runtime.process.WorkItemHandler Every Work Item Handler must define two methods: executeWorkItem(WorkItem workItem, WorkItemManager manager) → Executes your logic. abortWorkItem(WorkItem workItem, WorkItemManager manager) → Defines what happens when the work item is canceled. ⚙️ 2️⃣ Create the Custom Handler Class Let’s create ...