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 Java - 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:

Project Structure

Java Project Java

A Java project includes Excel source files and compiles them to XML:

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
├── pom.xml                   # Maven configuration
└── src/main/java/
    └── CompileRules.java     # Compiles Excel → XML
    └── TestRules.java        # Runs test cases

Go Project Go

A Go project consumes pre-compiled XML files (compiled by Java):

project/
├── xml/                      # Pre-compiled XML files
│   ├── MyRules_edd.xml       # (from Java compilation)
│   └── MyRules_dt.xml
├── testfiles/                # Test case input files
└── main.go                   # Your Go application (optional)

Note: Go projects require XML files that were compiled using the Java compiler. See Choosing an Implementation for the full workflow.

Links