Advanced Features
The BankLingo Process Engine includes advanced BPMN 2.0 capabilities implemented across Phases 1-5.
Overview
These advanced features extend the core BPMN functionality with production-ready implementations:
| Phase | Feature | Status | Description |
|---|---|---|---|
| Phase 1 | Multi-Instance Subprocess | ✅ Production | Execute subprocess multiple times in parallel or sequence |
| Phase 2 | Async Boundaries | ✅ Production | Return API response immediately, continue in background |
| Phase 3 | Callbacks | ✅ Production | Wait for subprocess or external system completion |
| Phase 4 | Timer Events | ✅ Production | Schedule tasks, timeouts, and repeating timers |
| Phase 5 | Error Handling | ✅ Production | Structured error management with recovery patterns |
Quick Links
Phase 1: Multi-Instance Execution
Process collections of data in parallel or sequence:
- Multi-Instance Overview - Core concepts
- Collection Processing - Batch operations
- Use Cases: Batch order processing, parallel validations, aggregation
Phase 2: Async Boundaries
Enable background processing with immediate API responses:
- Async Boundaries - Background execution
- Mobile Patterns - Mobile app optimization
- Use Cases: Report generation, file processing, long-running tasks
Phase 3: Callbacks
Wait for external events and subprocess completion:
- Callbacks Overview - Subprocess and external callbacks
- Callback Patterns - Integration strategies
- Use Cases: External API integration, subprocess orchestration
Phase 4: Timer Events
Schedule and delay process execution:
- Timer Events - All timer types
- ISO 8601 Guide - Date and duration formats
- Scheduled Tasks - Cron-like patterns
- Use Cases: SLA enforcement, payment reminders, periodic checks
Phase 5: Error Handling
Structured error management with recovery:
- Error Handling Overview - Architecture
- Boundary Error Events - Task-level catching
- Error End Events - Process termination
- JavaScript Errors - BpmnError throwing
- Error Recovery Patterns - Retry and fallback
- Use Cases: API failures, validation errors, timeout handling
Feature Comparison
When to Use Each Feature
| Scenario | Feature | Why |
|---|---|---|
| Process 100 orders | Multi-Instance | Parallel execution |
| Generate report | Async Boundary | Immediate response |
| Wait for payment gateway | Callbacks | External system integration |
| Enforce 48h SLA | Timer Events | Timeout boundary event |
| Handle API failures | Error Handling | Structured retry logic |
Learning Path
Beginner Level
- Start with Timer Events - Easiest to understand
- Try Async Boundaries - Simple configuration
- Learn Error Handling - Critical for production
Intermediate Level
- Master Multi-Instance - Batch processing
- Implement Callbacks - External integration
- Combine features for complex workflows
Advanced Level
- Build fault-tolerant workflows with error recovery
- Optimize performance with async boundaries
- Create orchestration patterns with callbacks
Integration Examples
Example 1: Batch Processing with Error Handling
<!-- Multi-instance subprocess with error boundaries -->
<bpmn:subProcess id="ProcessOrders" name="Process Each Order">
<bpmn:multiInstanceLoopCharacteristics isSequential="false">
<custom:properties>
<custom:property name="collection" value="context.orders"/>
<custom:property name="elementVariable" value="currentOrder"/>
</custom:properties>
</bpmn:multiInstanceLoopCharacteristics>
<bpmn:scriptTask id="ProcessOrder" name="Process Order">
<!-- Error handling integrated -->
</bpmn:scriptTask>
<!-- Boundary error event for individual order failures -->
<bpmn:boundaryEvent id="OrderError" attachedToRef="ProcessOrder">
<bpmn:errorEventDefinition/>
</bpmn:boundaryEvent>
</bpmn:subProcess>
Example 2: SLA Enforcement with Escalation
<!-- User task with timer boundary -->
<bpmn:userTask id="ApproveRequest" name="Manager Approval">
<!-- ... -->
</bpmn:userTask>
<!-- 48-hour timeout -->
<bpmn:boundaryEvent id="Timeout" attachedToRef="ApproveRequest" cancelActivity="true">
<bpmn:timerEventDefinition>
<bpmn:timeDuration>P2D</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:boundaryEvent>
<!-- Escalation on timeout -->
<bpmn:scriptTask id="Escalate" name="Escalate to Director">
<!-- ... -->
</bpmn:scriptTask>
Example 3: Background Report with Callback
<!-- Async boundary for immediate response -->
<bpmn:scriptTask id="GenerateReport" name="Generate Report" camunda:asyncBefore="true">
<bpmn:extensionElements>
<custom:properties>
<custom:property name="asyncBoundary" value="true"/>
<custom:property name="asyncBoundaryResponse"><![CDATA[{
"jobId": "context.reportJobId",
"status": "processing"
}]]></custom:property>
</custom:properties>
</bpmn:extensionElements>
<!-- Long-running operation -->
</bpmn:scriptTask>
<!-- Callback when external service completes -->
<bpmn:receiveTask id="WaitForCompletion" name="Wait for Upload">
<!-- Callback mechanism -->
</bpmn:receiveTask>
Architecture Integration
All advanced features integrate seamlessly with the core engine:
Process Execution
↓
Task Detection
↓
┌───────────────────────────────┐
│ Feature Detection │
│ - Multi-instance? │
│ - Async boundary? │
│ - Timer event? │
│ - Error boundary? │
└───────────┬───────────────────┘
↓
Feature-Specific Execution
↓
State Management
↓
Continue or Pause
Performance Characteristics
| Feature | Overhead | Scalability | Best For |
|---|---|---|---|
| Multi-Instance | Low | Linear | < 1000 items |
| Async Boundary | Minimal | High | Any long task |
| Callbacks | Minimal | High | External waits |
| Timer Events | Low | High | Any delays |
| Error Handling | Minimal | High | All tasks |
Database Impact
Phase 3: CallbackRegistry Table
CREATE TABLE CallbackRegistry (
Id BIGINT PRIMARY KEY,
ProcessInstanceId NVARCHAR(200),
CallbackType NVARCHAR(50),
Status NVARCHAR(50)
);
Phase 4: ProcessTimers Table
CREATE TABLE ProcessTimers (
Id BIGINT PRIMARY KEY,
ProcessInstanceId NVARCHAR(200),
TimerEventId NVARCHAR(200),
NextFireTime DATETIME,
Status NVARCHAR(50)
);
Phase 5: Error Context
Stored in ProcessState JSON:
{
"errorHistory": [
{
"errorCode": "API_ERROR",
"errorMessage": "Service unavailable",
"timestamp": "2026-01-10T10:30:00Z"
}
]
}
Next Steps
- Choose a feature based on your use case
- Read the detailed documentation for that feature
- Try the examples in the documentation
- Combine features for complex workflows
Related Documentation
- Task Types - Core BPMN tasks
- Gateways - Decision logic
- Examples - Complete workflows
- API Reference - Process commands
Version: 2.0 (Phases 1-5)
Last Updated: January 2026