Intermediate Events in jBPM – Complete Guide with Examples
Intermediate Events in jBPM are BPMN elements that occur between the start and end of a workflow.
They allow you to pause, wait, send signals, catch messages, trigger timers, handle errors, and create real-life, production-ready business workflows.
In jBPM, Intermediate Events work through the BPMN2 engine and behave exactly as defined in the BPMN specification — but with jBPM-specific execution semantics such as Event Nodes, Node Instances, Signals, WorkItem interruptions, boundary events, and process instance correlation.
⭐ What Are Intermediate Events?
Intermediate Events in jBPM can:
✔ Catch something (wait)
✔ Throw something (send/trigger)
They appear in the process flow, attached to an activity, or placed in the sequence path.
Types of Intermediate Events in jBPM
Below is the full list — with examples, XML snippets, and usage.
1️⃣ Timer Intermediate Event (Catch)
Used to delay or schedule actions inside a process.
📌 Examples:
-
Wait for 2 days before sending a reminder
-
Check SLA expiration
-
Daily scheduled checks (cron)
XML Example
Business Central
You configure delay using:
Duration, Cycle, or Date (ISO-8601).
2️⃣ Message Intermediate Catch Event
Used when jBPM must wait for an external system to send a message.
In jBPM, messages are correlated using:
-
MessageRef
-
CorrelationKey (optional)
📌 Use cases:
-
Wait for payment confirmation
-
Wait for verification from an external microservice
-
Wait for a file to be uploaded
Example
You then trigger it using:
3️⃣ Message Intermediate Throw Event
Used to send messages to other processes.
📌 Example
-
Trigger a downstream workflow
-
Notify another jBPM process instance
-
Send asynchronous event to microservices via custom handlers
4️⃣ Signal Intermediate Events (Throw & Catch)
A signal is a broadcast event.
All active processes listening for the signal will respond.
📌 Examples:
-
"PaymentCompleted"
-
"DocumentUploaded"
-
"FraudDetected"
Catching Signal
Throwing Signal
Triggering from Java
5️⃣ Error Intermediate Event (Catch)
Used to capture errors thrown inside a task.
In jBPM, you can attach these to nodes:
-
Service Tasks
-
Script Tasks
-
WorkItemHandlers
📌 Example:
An API call fails → throw error → catch error → move to fallback path.
Process XML
Throwing from Java
6️⃣ Escalation Intermediate Events (Throw & Catch)
Escalations are non-fatal alerts.
Use cases:
✔ SLA warning
✔ Supervisor notification
✔ Business exception that should not kill the process
Example Throw
7️⃣ Compensation Intermediate Events
Used to roll back previous actions.
📌 Real-world examples:
-
Refund a payment
-
Reverse stock allocation
-
Undo reservation
jBPM compensation works through compensation handlers attached to activities.
XML
8️⃣ Conditional Intermediate Event
Triggered when a condition becomes true at runtime.
📌 Example:
If approvalAmount > 50000, trigger a different path.
XML
Comparison Table
Event Type | Catch | Throw | Typical Usage |
|---|---|---|---|
| Timer | ✔ | ✖ | Wait for time or schedule |
| Message | ✔ | ✔ | System-to-system communication |
| Signal | ✔ | ✔ | Broadcast to all processes |
| Error | ✔ | ✖ | Exception handling |
| Escalation | ✔ | ✔ | Business warnings |
| Compensation | ✔ | ✔ | Undo/rollback |
| Conditional | ✔ | ✖ | Trigger when condition matches |
Real-World Example: Insurance Claim Process
Scenario Flow:
-
Claim submitted
-
Timer waits for 24 hours pending documents
-
External system sends verification message
-
If mismatch → Error event → move to manual review
-
If SLA at risk → Escalation event
-
If fraud detected → Signal event triggers audit process
-
If claim rejected → Compensation refunds customer
-
Final settlement task executes
This shows how intermediate events support real-world business logic.
Best Practices for jBPM Intermediate Events
✔ Use message events for microservices communication
✔ Use signal events only when many processes must react
✔ Prefer error events over gateways for exceptions
✔ Use timers for reminders, SLAs, and delay logic
✔ Use conditional events for dynamic state changes
✔ Avoid mixing message, signal, and error handling in a single complex path
✔ Keep compensation actions simple and idempotent
💼 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 lectern | Digital rostrum | Digital metal podium
Comments
Post a Comment