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
- Auto-mapping - Automatic mapping between Java objects and 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
Implementations
| Implementation | Status | Use Case |
|---|---|---|
| Java | Production | Original implementation with full tooling |
| Go | Production | High-performance runtime, 130x faster operator lookup |
Java Implementation
The original Java implementation provides:
- Excel-to-XML compilers for decision tables
- Full IDE support and debugging
- Comprehensive test harness
- Production-proven stability
Go Implementation
The Go implementation provides:
- Full compatibility with Java DTRules XML formats
- High performance: 130x faster operator lookup, 24x faster arithmetic
- Zero-allocation hot paths for reduced GC pressure
- CLI tool for rule validation and execution
Requirements
Java
- Java 8+
- Apache Maven 3.x
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:
- Quick Start (UI) - Visual editing with the React UI
- Quick Start (Go) - High-performance CLI and API
- Quick Start (Java) - Full tooling with Excel compilers
Project Structure
A typical DTRules project has this structure:
project/
├── DecisionTables/ # Excel files with business rules
│ └── MyRules_dt.xls
├── edd/ # Entity Definition Documents
│ └── MyRules_edd.xls
├── xml/ # Compiled XML rule files (generated)
├── testfiles/ # Test case input files
├── DTRules.xml # Project configuration
└── src/main/java/ # Java code (optional)
└── CompileRules.java # Compiles Excel → XML
└── TestRules.java # Runs test cases