Skip to main content

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:

PhaseFeatureStatusDescription
Phase 1Multi-Instance Subprocess✅ ProductionExecute subprocess multiple times in parallel or sequence
Phase 2Async Boundaries✅ ProductionReturn API response immediately, continue in background
Phase 3Callbacks✅ ProductionWait for subprocess or external system completion
Phase 4Timer Events✅ ProductionSchedule tasks, timeouts, and repeating timers
Phase 5Error Handling✅ ProductionStructured error management with recovery patterns

Phase 1: Multi-Instance Execution

Process collections of data in parallel or sequence:

Phase 2: Async Boundaries

Enable background processing with immediate API responses:

Phase 3: Callbacks

Wait for external events and subprocess completion:

Phase 4: Timer Events

Schedule and delay process execution:

Phase 5: Error Handling

Structured error management with recovery:

Feature Comparison

When to Use Each Feature

ScenarioFeatureWhy
Process 100 ordersMulti-InstanceParallel execution
Generate reportAsync BoundaryImmediate response
Wait for payment gatewayCallbacksExternal system integration
Enforce 48h SLATimer EventsTimeout boundary event
Handle API failuresError HandlingStructured retry logic

Learning Path

Beginner Level

  1. Start with Timer Events - Easiest to understand
  2. Try Async Boundaries - Simple configuration
  3. Learn Error Handling - Critical for production

Intermediate Level

  1. Master Multi-Instance - Batch processing
  2. Implement Callbacks - External integration
  3. Combine features for complex workflows

Advanced Level

  1. Build fault-tolerant workflows with error recovery
  2. Optimize performance with async boundaries
  3. 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

FeatureOverheadScalabilityBest For
Multi-InstanceLowLinear< 1000 items
Async BoundaryMinimalHighAny long task
CallbacksMinimalHighExternal waits
Timer EventsLowHighAny delays
Error HandlingMinimalHighAll 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

  1. Choose a feature based on your use case
  2. Read the detailed documentation for that feature
  3. Try the examples in the documentation
  4. Combine features for complex workflows

Version: 2.0 (Phases 1-5)
Last Updated: January 2026