Muonroi.RuleEngine.DecisionTable
1.0.0-alpha.16
dotnet add package Muonroi.RuleEngine.DecisionTable --version 1.0.0-alpha.16
NuGet\Install-Package Muonroi.RuleEngine.DecisionTable -Version 1.0.0-alpha.16
<PackageReference Include="Muonroi.RuleEngine.DecisionTable" Version="1.0.0-alpha.16" />
<PackageVersion Include="Muonroi.RuleEngine.DecisionTable" Version="1.0.0-alpha.16" />
<PackageReference Include="Muonroi.RuleEngine.DecisionTable" />
paket add Muonroi.RuleEngine.DecisionTable --version 1.0.0-alpha.16
#r "nuget: Muonroi.RuleEngine.DecisionTable, 1.0.0-alpha.16"
#:package Muonroi.RuleEngine.DecisionTable@1.0.0-alpha.16
#addin nuget:?package=Muonroi.RuleEngine.DecisionTable&version=1.0.0-alpha.16&prerelease
#tool nuget:?package=Muonroi.RuleEngine.DecisionTable&version=1.0.0-alpha.16&prerelease
Muonroi.RuleEngine.DecisionTable
DMN-style decision table engine with FEEL expressions, multi-backend persistence, structural validation, and import/export for the Muonroi Rule Engine.
Decision tables let you encode business rules as a matrix of input conditions and output values — no code changes needed to update rule logic at runtime. This package provides the models, FEEL expression evaluator, validators, converters, serializers, and a pluggable store (in-memory, SQL Server, or PostgreSQL) that power the Muonroi decision table subsystem. The optional companion package Muonroi.RuleEngine.DecisionTable.Web exposes REST endpoints and a live-edit UI on top of this core engine.
Installation
dotnet add package Muonroi.RuleEngine.DecisionTable --prerelease
Quick Start
Register the engine in Program.cs. No connection string = in-memory store (ideal for testing and small deployments):
builder.Services.AddDecisionTableEngine();
Persist tables to PostgreSQL:
builder.Services.AddDecisionTableEngine(options =>
{
options.PostgresConnectionString =
builder.Configuration.GetConnectionString("RuleDb");
});
Execute a table once retrieved from the store:
using Muonroi.RuleEngine.DecisionTable;
using Muonroi.RuleEngine.DecisionTable.Models;
using Muonroi.RuleEngine.DecisionTable.Stores;
// IDecisionTableStore and IDecisionTableExecutor are injected via DI.
DecisionTable? table = await store.GetByIdAsync("loan-approval");
DecisionTableExecutionResult result = await executor.ExecuteAsync(
table!,
new Dictionary<string, object?>
{
["age"] = 35,
["income"] = 75_000m,
["score"] = 720
});
foreach (DecisionTableOutputRow row in result.MatchedRows)
{
Console.WriteLine(row.Outputs["decision"]); // e.g. "Approved"
}
See the full working example in Quickstart.DecisionTable.
Features
- FEEL expression evaluation — full FEEL cell evaluator (
FullFeelCellEvaluator) with a lightweight fallback (SimplifiedFeelCellEvaluator); numeric, string, range, and boolean expressions supported. - Nine hit policies —
First,Unique,Collect,Priority,OutputOrder,CollectSum,CollectMin,CollectMax,CollectCount. - Multi-backend persistence — in-memory (default), SQL Server, or PostgreSQL via EF Core; automatic schema migration on startup.
- Audit trail and versioning — every
SaveAsyncrecords an audit entry and increments a version snapshot; full history queryable throughIDecisionTableStore. - Structural validation —
DecisionTableValidatorchecks expression syntax, overlap, gaps, and multi-column redundancy before rules are persisted or executed. - Excel import —
ExcelToDecisionTableConverterreads Excel files within:/out:column headers directly into aDecisionTablemodel. - DMN 1.3 import/export —
DmnExporter.ExportToDmnXmlandDmnImporter.ImportFromDmnXmlprovide bidirectional spec-compliant DMN 1.3 XML exchange. - JSON and XML serializers —
DecisionTableJsonSerializerandDecisionTableXmlSerializerfor custom serialization needs. - Rule conversion —
DecisionTableToRuleConverterbridges a decision table into the Muonroi Rule Engine'sIRulepipeline. - Structural diffing —
DecisionTableDifferproduces aDecisionTableDiff(row adds/removes, cell changes, column schema changes) between two table versions. - Bulk operations —
IDecisionTableStore.BulkUpsertAsyncandBulkDeleteAsyncfor batch management.
Configuration
DI registration
builder.Services.AddDecisionTableEngine(options =>
{
// SQL Server persistence (optional)
options.SqlServerConnectionString = "Server=...";
// PostgreSQL persistence (optional, takes priority over SqlServer if both are set)
options.PostgresConnectionString = "Host=...";
// Database schema (default: "dbo")
options.Schema = "rules";
// Automatically create/migrate the schema on startup (default: true)
options.AutoMigrateDatabase = true;
});
DecisionTableEngineOptions
| Property | Type | Default | Purpose |
|---|---|---|---|
SqlServerConnectionString |
string? |
null |
SQL Server connection string for EF Core persistence |
PostgresConnectionString |
string? |
null |
PostgreSQL connection string for EF Core persistence |
Schema |
string |
"dbo" |
Database schema name |
AutoMigrateDatabase |
bool |
true |
Run EF migrations on IHostedService startup |
When neither connection string is set, InMemoryDecisionTableStore is registered.
API Reference
| Type | Purpose |
|---|---|
IDecisionTableExecutor |
Evaluates a DecisionTable against input facts; returns DecisionTableExecutionResult |
IDecisionTableStore |
CRUD, bulk ops, versioning, audit trail, and row reordering |
DecisionTable |
Core model — columns, rows, hit policy, version, tenant ID |
DecisionTableColumn |
Describes an input or output column |
DecisionTableRow |
One row of conditions and outputs (list of DecisionTableCell) |
DecisionTableCell |
A single cell value, including a parsed CellExpression |
HitPolicy |
Enum: First, Unique, Collect, Priority, OutputOrder, CollectSum, CollectMin, CollectMax, CollectCount |
DecisionTableExecutionResult |
Execution output: matched DecisionTableOutputRow list |
DecisionTableEngineOptions |
DI configuration for storage backend |
DecisionTableValidator |
Validates structure, FEEL expressions, overlaps, gaps, and redundancy |
ExcelToDecisionTableConverter |
Imports from an Excel file or stream |
DecisionTableToRuleConverter |
Converts a decision table into IRule pipeline rules |
DecisionTableDiffer |
Diffs two DecisionTable versions into a DecisionTableDiff |
DecisionTableJsonSerializer |
Serializes/deserializes tables to JSON |
DecisionTableXmlSerializer |
Serializes/deserializes tables to DMN-compatible XML |
DmnExporter |
Static — exports DecisionTable to DMN 1.3 XML string |
DmnImporter |
Static — parses DMN 1.3 XML into DecisionTable |
IFeelCellEvaluator |
FEEL expression evaluator contract |
FeelParser |
Parses FEEL expressions into FeelType-tagged CellExpression nodes |
IDecisionTableStore |
Store contract (query, get, save, bulk, reorder, history, audit, delete) |
InMemoryDecisionTableStore |
Volatile in-memory implementation |
Samples
- Quickstart.DecisionTable — minimal ASP.NET Core API wiring
AddDecisionTableEnginewith a PostgreSQL backend and Swagger UI
Compatibility
- Target framework:
net8.0 - License: Apache-2.0 (OSS)
Related Packages
Muonroi.RuleEngine.Abstractions— shared contracts (IRule,FactBag,RuleResult) that this package builds onMuonroi.RuleEngine.DecisionTable.Web— REST controllers and live-edit UI layer over this engineMuonroi.RuleEngine.Core— rule orchestrator that can consume decision tables viaDecisionTableToRuleConverterMuonroi.Data.EntityFrameworkCore— EF Core base infrastructure used by the persistent store
License
Apache-2.0. See LICENSE-APACHE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- ExcelDataReader (>= 3.7.0)
- ExcelDataReader.DataSet (>= 3.7.0)
- Muonroi.Data.EntityFrameworkCore (>= 1.0.0-alpha.16)
- Muonroi.RuleEngine.Abstractions (>= 1.0.0-alpha.16)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Muonroi.RuleEngine.DecisionTable:
| Package | Downloads |
|---|---|
|
Muonroi.RuleEngine.Runtime
Runtime orchestration layer for Muonroi RuleEngine, providing execution pipelines and integration points for rule evaluation services. |
|
|
Muonroi.RuleEngine.DecisionTable.Web
Web API and UI assets for Muonroi Decision Table Designer. |
|
|
muonroi-mcp-dev
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.16 | 78 | 6/22/2026 |
| 1.0.0-alpha.15 | 133 | 5/31/2026 |
| 1.0.0-alpha.14 | 140 | 5/15/2026 |
| 1.0.0-alpha.13 | 110 | 5/2/2026 |
| 1.0.0-alpha.12 | 95 | 4/2/2026 |
| 1.0.0-alpha.11 | 129 | 4/2/2026 |
| 1.0.0-alpha.9 | 67 | 3/30/2026 |
| 1.0.0-alpha.8 | 161 | 3/28/2026 |
| 1.0.0-alpha.7 | 77 | 3/27/2026 |
| 1.0.0-alpha.5 | 62 | 3/27/2026 |
| 1.0.0-alpha.4 | 63 | 3/27/2026 |
| 1.0.0-alpha.3 | 61 | 3/27/2026 |
| 1.0.0-alpha.2 | 60 | 3/26/2026 |
| 1.0.0-alpha.1 | 91 | 3/8/2026 |