Getting Started
DTRules is a production-ready rules engine that allows business analysts and policy experts to define complex business logic using Decision Tables in Excel spreadsheets, combined with a human-readable Domain Specific Language (DSL).
Overview
Decision Tables provide a tabular representation of business rules that can be understood by both policy experts and developers. The DSL ensures that conditions and actions are written in clear, readable syntax rather than code.
Key Features
- Excel-based Rule Definition - Define rules in familiar spreadsheet format
- Domain Specific Languages - EL (Expression Language) for readable conditions and actions
- Entity Data Model - Define your data structures in Excel
- JSON Data Mapping - Map JSON data to rule entities
- Test Harness - Built-in testing framework for validating rules
- Trace & Debug - Comprehensive tracing for debugging rule execution
Production Use
DTRules has been used in production systems including:
- State welfare/assistance programs (Texas TIERS, Ohio OFAST)
- Insurance eligibility determination systems
- Commercial business logic applications
Go Implementation
The Go implementation provides:
- High performance: 130x faster operator lookup, 24x faster arithmetic
- Zero-allocation hot paths for reduced GC pressure
- CLI tool for rule validation and execution
- REST API for language-agnostic integration
- Visual UI for interactive rule editing and testing
Requirements
Go
- Go 1.21+
Visual UI
- Node.js 18+ (frontend)
- Go 1.21+ (backend)
Quick Start Options
Choose the quick start guide that matches your use case:
- Choosing an Implementation - Understand the workflow
- Quick Start (UI) - Visual editing with the React UI
- Quick Start (Go) - High-performance CLI and API
- Quick Start (Tax Return) Demo - Explore the comprehensive tax calculation sample
Project Structure
Project Structure
A DTRules project includes Excel source files and compiled XML:
project/
├── DecisionTables/ # Excel files with business rules
│ └── MyRules_dt.xls
├── edd/ # Entity Definition Documents
│ └── MyRules_edd.xls
├── xml/ # Compiled XML rule files
│ ├── MyRules_edd.xml
│ └── MyRules_dt.xml
├── testfiles/ # Test case input files
├── DTRules.xml # Project configuration
└── main.go # Your Go application (optional)