Muonroi.RuleEngine.DecisionTable 1.0.0-alpha.16

This is a prerelease version of Muonroi.RuleEngine.DecisionTable.
dotnet add package Muonroi.RuleEngine.DecisionTable --version 1.0.0-alpha.16
                    
NuGet\Install-Package Muonroi.RuleEngine.DecisionTable -Version 1.0.0-alpha.16
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Muonroi.RuleEngine.DecisionTable" Version="1.0.0-alpha.16" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Muonroi.RuleEngine.DecisionTable" Version="1.0.0-alpha.16" />
                    
Directory.Packages.props
<PackageReference Include="Muonroi.RuleEngine.DecisionTable" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Muonroi.RuleEngine.DecisionTable --version 1.0.0-alpha.16
                    
#r "nuget: Muonroi.RuleEngine.DecisionTable, 1.0.0-alpha.16"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Muonroi.RuleEngine.DecisionTable@1.0.0-alpha.16
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Muonroi.RuleEngine.DecisionTable&version=1.0.0-alpha.16&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Muonroi.RuleEngine.DecisionTable&version=1.0.0-alpha.16&prerelease
                    
Install as a Cake Tool

Muonroi.RuleEngine.DecisionTable

DMN-style decision table engine with FEEL expressions, multi-backend persistence, structural validation, and import/export for the Muonroi Rule Engine.

NuGet License: Apache 2.0

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 policiesFirst, 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 SaveAsync records an audit entry and increments a version snapshot; full history queryable through IDecisionTableStore.
  • Structural validationDecisionTableValidator checks expression syntax, overlap, gaps, and multi-column redundancy before rules are persisted or executed.
  • Excel importExcelToDecisionTableConverter reads Excel files with in: / out: column headers directly into a DecisionTable model.
  • DMN 1.3 import/exportDmnExporter.ExportToDmnXml and DmnImporter.ImportFromDmnXml provide bidirectional spec-compliant DMN 1.3 XML exchange.
  • JSON and XML serializersDecisionTableJsonSerializer and DecisionTableXmlSerializer for custom serialization needs.
  • Rule conversionDecisionTableToRuleConverter bridges a decision table into the Muonroi Rule Engine's IRule pipeline.
  • Structural diffingDecisionTableDiffer produces a DecisionTableDiff (row adds/removes, cell changes, column schema changes) between two table versions.
  • Bulk operationsIDecisionTableStore.BulkUpsertAsync and BulkDeleteAsync for 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 AddDecisionTableEngine with a PostgreSQL backend and Swagger UI

Compatibility

  • Target framework: net8.0
  • License: Apache-2.0 (OSS)

License

Apache-2.0. See LICENSE-APACHE.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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