Decision Orchestration in Aletyx Enterprise Build of Kogito and Drools 10.1.0-aletyx
Decision orchestration brings together rule execution, decision logic, and process flows to create powerful automation solutions. Aletyx Enterprise Build of Kogito and Drools supports multiple approaches for orchestrating decisions—from modern Rule Units in Kogito to classic Ruleflow patterns in Drools KJARs—enabling teams to build sophisticated decision services that scale across enterprise environments.Understanding Decision Orchestration
Decision orchestration coordinates the execution of multiple decision components within a larger process flow. Instead of isolated rule evaluations, orchestration allows you to:- Sequence decision logic across multiple rule sets or DMN models
- Control execution flow with conditional branching and parallel evaluation
- Integrate decisions with processes using BPMN workflows
- Maintain state across complex decision chains
- Handle exceptions and recovery patterns systematically
Orchestration Approaches
Modern Approach: Rule Units in Kogito
The recommended approach for new development uses Rule Units within Kogito applications. Rule Units provide a modular, type-safe way to organize and execute decision logic. Key characteristics:- Code-centric design with compile-time safety
- Native Quarkus and Spring Boot integration
- Cloud-native deployment with fast startup and low memory footprint
- Event-driven architecture with built-in Kafka support
- OpenAPI-generated REST interfaces
Classic Approach: Ruleflows in Drools KJAR
For enterprises migrating from earlier Drools versions, Aletyx Enterprise Build of Kogito and Drools provides continued support for Ruleflow orchestration patterns via thestartProcess API in KJAR deployments.
Aletyx Enterprise Ruleflow SupportThe
startProcess method is available exclusively in Aletyx Enterprise for KJAR-packaged applications. See Drools Ruleflow documentation for details.- Name:
ClassicRuleFlow - Value:
true
Hybrid Approach: Business Rule Tasks in BPMN
Both Kogito and traditional jBPM processes support Business Rule Tasks to embed decision logic within larger process orchestrations. Business Rule Task capabilities:- DMN integration: Execute DMN decision models with specified inputs
- DRL integration: Invoke Rule Units for complex rule evaluation
- Data mapping: Transform process variables to/from decision inputs/outputs
- Synchronous execution: Decision completes before process continues
- Add a Business Rule Task to your BPMN process
- Configure the rule implementation:
- DMN: Specify namespace and model name
- DRL: Specify Rule Unit class name
- Map process variables to decision inputs
- Map decision outputs back to process variables
- Handle results in subsequent process steps
Decision Orchestration Patterns
Sequential Decision Chain
Execute decisions in a defined sequence where each decision may influence the next. Use case: Multi-stage approval process- Kogito: Chain multiple Rule Unit invocations within a BPMN process
- KJAR: Use Ruleflow with sequential Ruleflow Groups
- BPMN: Connect multiple Business Rule Tasks in sequence
Parallel Decision Evaluation
Evaluate multiple independent decision sets concurrently for performance. Use case: Risk assessment from multiple perspectives- Kogito: Use parallel gateways in BPMN with separate Business Rule Tasks
- KJAR: Define parallel branches in Ruleflow process
- BPMN: Configure parallel gateway with multiple rule evaluations
Conditional Decision Routing
Route to different decision logic based on runtime conditions. Use case: Product-specific pricing rules- Kogito: Use exclusive gateways in BPMN to route to appropriate Rule Units
- KJAR: Use Ruleflow with conditional branching between Ruleflow Groups
- BPMN: Configure gateway conditions based on process variables
Deployment Models
Kogito Microservices
Deploy individual decision services as independent microservices. Characteristics:- One service per bounded context: Separate credit scoring, fraud detection, etc.
- Independent scaling: Scale high-demand services independently
- Event-driven communication: Services interact via Kafka topics
- Container deployment: Docker, Kubernetes, OpenShift
Monolithic KJAR Deployment
Deploy comprehensive decision logic as a single application. Characteristics:- All rules in one KJAR: Centralized rule repository
- Shared KieSession: Efficient memory usage for related rules
- Spring Boot or standalone: Flexible deployment options
- Traditional application server support: WebSphere, WebLogic, JBoss EAP
Hybrid Architecture
Combine Kogito microservices for new capabilities with KJAR systems during migration. Migration strategy:- Identify bounded contexts: Determine logical separation of decision domains
- Extract high-value decisions: Move frequently changed rules to Kogito first
- Maintain KJAR for stable logic: Keep mature, stable rules in existing KJAR
- Use event integration: Connect systems via Kafka for loose coupling
- Gradual migration: Move rules incrementally as business value dictates
Integration with Processes
Event-Driven Process Integration
Connect decision services with process workflows via events. Architecture:Service Orchestration Integration
Embed decisions within service orchestration workflows. Pattern:- Process service invokes decision service via REST
- Decision service returns results synchronously
- Process continues with decision outputs
Best Practices
Design Principles
- Separate concerns: Keep decision logic separate from process flow
- Modular units: Design Rule Units around bounded contexts
- Stateless decisions: Prefer stateless decision evaluations when possible
- Clear interfaces: Define explicit inputs and outputs for each decision point
- Version control: Track decision logic changes alongside code
Performance Optimization
- Minimize state: Reduce working memory size in rule sessions
- Optimize rule conditions: Place most selective conditions first (LHS)
- Use parallel evaluation: Execute independent decisions concurrently
- Cache results: Store decision outputs when inputs haven’t changed
- Monitor execution: Track rule firing statistics and execution times
Testing Strategy
- Unit test Rule Units: Test individual Rule Units with comprehensive scenarios
- Integration test orchestration: Verify decision sequences in full flows
- Performance test at scale: Validate throughput under production load
- Test decision correctness: Validate business logic accuracy
- Test error handling: Ensure graceful degradation on failures
Monitoring and Observability
Key Metrics
Track these metrics for decision orchestration health:- Decision execution time: Latency per decision evaluation
- Rule firing frequency: Which rules execute most often
- Decision throughput: Decisions processed per second
- Error rates: Failed evaluations and exceptions
- Resource utilization: CPU and memory consumption
Prometheus Metrics Example
Next Steps
- Learn Rule Units: Understanding Rule Units
- Explore Ruleflows: Drools Ruleflow Guide
- Master BPMN: BPMN Activities
- Event Integration: Event-Driven Architecture
- Get Support: Contact Aletyx for migration assistance