jBPM Workflow Tutorial: ❌ Exclusive Gateway (XOR)
🚀 Introduction
The ❌ Exclusive Gateway (XOR) in jBPM is used when only one path should be taken from multiple alternatives.
It evaluates conditions on outgoing sequence flows and directs the process to the first condition that evaluates to true.
This makes it ideal for approve/reject style workflows.
🛠️ Prerequisites
-
💻 jBPM/Business Central & KIE Server installed
-
☕ JDK 11+ (or JDK 17)
-
👨💼 User with
managerrole -
🌐 Access to:
http://localhost:8080/business-central
📝 Step 1: Create a New Process
-
🔑 Log in to Business Central
-
📂 Create project: xor-approval
-
➕ Add Business Process: XorApprovalProcess
-
Id:
com.example.xorapproval -
Package:
com.example
-
🎨 Step 2: Design the Workflow
-
🔵 Add a Start node
-
👤 Add a Human Task → assign to
manager -
❌ Add an Exclusive Gateway (XOR)
-
✅ Add an End node for Approval path
-
❌ Add another End node for Rejection path
-
🔗 Connect nodes: Start → Human Task → XOR Gateway → Approved End / Rejected End
📊 Step 3: Define Data
-
Add process variable:
-
Name:
approved -
Type:
Boolean
-
-
In Human Task form, allow user to set
approved = true/false
⚙️ Step 4: Configure Gateway Conditions
-
✅ Approval Path → condition:
-
❌ Rejection Path → condition:
👉 If no condition matches, the process may stall — ensure one path is always true.
🔨 Step 5: Build and Deploy
-
💾 Save the process
-
🛠️ Build & Install project
-
📦 Deploy to KIE Server
▶️ Step 6: Run the Process
-
Go to Manage → Process Definitions
-
▶️ Start a new instance of XorApprovalProcess
-
👤 Human Task assigned → open form → choose approve/reject
📌 Step 7: Observe the Outcome
-
✅ If approved = true → process follows Approval End node
-
❌ If approved = false → process follows Rejection End node
👉 Watch jBPM Workflow Tutorial: ❌ Exclusive Gateway (XOR) in Action better:
🛠️ Troubleshooting
-
❌ Task not showing? Ensure your user is in
managerrole -
⚠️ Both paths firing? → Check conditions are mutually exclusive
-
🔄 Process stuck at XOR? → Add a default path without condition
🎯 Conclusion
The ❌ Exclusive Gateway (XOR) is the simplest decision-making gateway in jBPM. It ensures that only one path is taken based on process data or user input.
This example showed how to build an approve/reject flow, a common pattern in real-world business processes.
By mastering XOR gateways, you can:
-
📝 Simplify approval workflows
-
🔀 Control process branching
-
✅ Ensure clean decision-making logic
Next, try combining XOR gateways with Human Tasks and Service Tasks to create practical business workflows.
💼 Professional Support Available
If you are facing issues in real projects related to enterprise backend development or workflow automation, I provide paid consulting, production debugging, project support, and focused trainings.
Technologies covered include Java, Spring Boot, PL/SQL, Azure, and workflow automation (jBPM, Camunda BPM, RHPAM).
📧 Contact: ishikhanirankari@gmail.com | info@realtechnologiesindia.com
🌐 Website: IT Trainings | Digital metal podium
Comments
Post a Comment