PowerDecision Concepts Guide
Overview
PowerDecision is a DMN-based decision automation engine that transforms business rules into executable decision models. It allows business analysts to define rules in a visual wizard or JSON format, which are automatically converted to industry-standard DMN (Decision Model and Notation) and evaluated by the KIE/Kogito engine.
Key Idea: Business users define what the decision should be (rules, conditions, outputs). PowerDecision handles how to execute it (DMN conversion, FEEL compilation, runtime evaluation).
Core capabilities:
- JSON-to-DMN conversion — Automatic generation of DMN XML from wizard JSON
- DMN evaluation — Standards-compliant execution via KIE/Kogito
- Decision templates — 7 pre-built templates across banking, insurance, retail, and IT
- Model management — Upload, register, list, and version decision models
- Async job execution — Submit decisions as jobs, poll for results
- PDP integration — Serves the Decide phase in PowerOrchestrator pipelines
DMN Decision Engine
What Is DMN?
DMN (Decision Model and Notation) is an OMG standard for modeling and executing business decisions. It provides:
- Decision Tables — Matrix of conditions (inputs) and outcomes (outputs)
- FEEL (Friendly Enough Expression Language) — A standardized expression language for conditions and calculations
- Hit Policies — Rules for handling multiple matching rows
- Portability — DMN models can be shared between compliant engines
Kogito & KIE Runtime
PowerDecision uses two evaluation paths:
| Path | When Used | Technology |
|---|---|---|
| Build-time (Kogito) | Models bundled in the application at compile time | Kogito DecisionModels CDI bean |
| Runtime (KIE) | Models uploaded via API after deployment | KieServices + KieFileSystem + DMNRuntime |
The DecisionService tries Kogito first, then falls back to the runtime evaluator for uploaded models.
Wizard-to-DMN Pipeline
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ Wizard │ │ JSON │ │ DMN │ │ KIE │
│ (UI) │ ──▶ │ Schema │ ──▶ │ XML │ ──▶ │ Engine │
│ │ │ │ │ │ │ │
└──────────┘ └──────────┘ └──────────┘ └──────────┘
model_id DmnGenerator RuntimeDmn
inputs_schema Evaluator
outputs_schema
policy + rules
JSON Schema
The wizard JSON defines a complete decision model:
- model_id — Unique identifier (becomes the DMN model name)
- version — Semantic version
- inputs_schema — Input fields with types, constraints, and validation rules
- outputs_schema — Output fields with types
- policy — Hit policy and conflict resolution settings
- rules — Array of when/then rules with conditions and outcomes
- metadata — Owner, description, tags, sector, timestamps
DMN Generation
The DmnGenerator transforms wizard JSON into DMN XML:
- Creates
inputDataelements frominputs_schemawith FEEL type mapping - Creates a
decisionelement withinformationRequirementlinks to inputs - Builds a
decisionTablewith the specified hit policy - Converts each rule’s
whenconditions to FEEL unary tests (e.g.,>= 750) - Converts
thenoutputs to FEEL values or context expressions - Handles multi-output tables using FEEL context syntax:
{a: 1, b: "x"}
Runtime Evaluation
The RuntimeDmnEvaluator loads DMN files dynamically:
- Reads the DMN XML from the model storage directory
- Creates a KIE container with the model
- Obtains a
DMNRuntimeand loads theDMNModel - Creates a
DMNContextfrom the input values - Calls
evaluateAll()to execute the decision table - Returns the
DMNResultwith all decision outputs
Hit Policies
Hit policies determine what happens when multiple rules match the same inputs:
| Policy | Multiple Matches? | Use Case |
|---|---|---|
FIRST | Yes — first wins | Priority-ordered rules with default fallback (most common) |
UNIQUE | No — fails | Mutually exclusive conditions (e.g., ranges that don’t overlap) |
PRIORITY | Yes — highest priority | Rules with explicit priority ordering |
ANY | Yes — must agree | Redundant rules that all produce the same result |
COLLECT | Yes — return all | Aggregate multiple outputs (e.g., list of applicable discounts) |
Auto-Correction: If UNIQUE is specified but a default rule exists, PowerDecision automatically switches to FIRST to prevent evaluation failures.
FEEL Expressions
Simple Conditions
The wizard JSON operators map directly to DMN FEEL unary tests:
{"credit_score": {"gte": 750}} → >= 750
{"status": {"eq": "EMPLOYED"}} → "EMPLOYED"
{"age": {"between": [18, 65]}} → [18..65]
{"tier": {"in": ["A", "B"]}} → in ("A", "B")
{"default": true} → - (match all)
Compound Conditions
Conditions can be combined with and/or:
{"score": {"and": [{"gte": 600}, {"lt": 750}]}} → >= 600 and < 750
{"tier": {"or": [{"eq": "A"}, {"eq": "B"}]}} → ("A") or ("B")
Model Lifecycle
Built-in vs Runtime Models
| Type | How Added | Storage | Evaluated By |
|---|---|---|---|
| Built-in | Bundled in classpath at build time | Classpath (src/main/resources/dmn/) | Kogito DecisionModels |
| Runtime | Uploaded via POST /models/upload | Filesystem (/app/models/) | RuntimeDmnEvaluator |
Model Storage
Runtime models are persisted in two places:
- Filesystem — DMN XML files in the
models/directory (Docker volume/app/models) - Redis — Model registry metadata (model_id, version, name, status, file path, uploaded timestamp)
On startup, the ModelRepository loads from Redis and also scans the filesystem for orphaned .dmn files (e.g., if Redis was flushed but the volume persisted).
Decision Templates
PowerDecision ships with 7 pre-built templates in decision-templates/. Each template is a complete wizard JSON file that can be uploaded directly via the model upload API:
- Loan Approval — Credit score, income, employment, debt-to-income analysis
- Credit Limit Determination — Dynamic credit limits from risk factors
- Customer Risk Classification — Risk tier assignment for underwriting
- Fraud Detection — Transaction scoring and suspicious activity flagging
- Insurance Premium Calculation — Premium pricing from risk profiles
- Product Recommendation — Product suggestions from customer attributes
- Support Ticket Routing — Priority assignment and department routing
Job Execution
Decisions are executed through an asynchronous job model:
POST /decisionscreates a job with statusPENDINGand returns ajobId- The DecisionService resolves the model (Kogito or runtime)
- Status moves to
PROCESSINGduring evaluation - On success: result is stored with status
SUCCESS - On failure: error details stored with status
ERROR GET /decisions/{jobId}returns the current status and result
The response includes decision (result data), explanation (matched rules, confidence), and metadata (timing information).
PDP Integration
PowerDecision serves the Decide phase in the PDP (Predict-Decide-Plan) pipeline:
PowerForecast → PowerDecision → PowerSolver
(Predict) (Decide) (Plan)
│
├── Receives forecast context
├── Evaluates business rules
└── Returns decision + explanation
When called by PowerOrchestrator, the decision context typically includes forecast outputs from a previous pipeline stage. The decision result flows to PowerSolver for constraint-based planning.
Health Endpoint: PowerOrchestrator monitors PowerDecision via GET /q/health (Quarkus SmallRye Health). The custom /health/liveness and /health/readiness endpoints are also available.