Frequently Asked Questions
Common questions about DTRules and decision tables.
What is DTRules?
DTRules is a decision table rules engine that lets you express complex business logic using spreadsheet-like tables. Instead of writing if-else chains in code, you define your rules in Excel or a visual editor, making them readable and maintainable by both developers and business analysts.
How does DTRules compare to other rule engines?
Unlike BRMS systems that use forward-chaining inference (like Drools), DTRules uses decision tables for deterministic rule execution. This means rules execute in a predictable, top-to-bottom order. The result is faster execution, easier debugging, and rules that business people can actually read and understand.
What programming languages are supported?
DTRules has a native Go implementation that provides 130x faster operator lookup and includes a REST API for language-agnostic integration. The rules engine has 20+ years of production use.
Is DTRules open source?
Yes! DTRules is released under the Apache License 2.0. You can use it freely in commercial and non-commercial projects, modify the source code, and distribute your modifications. The only requirement is to include the license notice in distributions.
How do I get started?
Start with the quickstart guide. You'll create a simple decision table, define your data model using EDD (Entity Description Dictionary), and execute your first rules in about 10 minutes.
Can business users edit the rules?
Yes! Decision tables can be authored in Excel, making them accessible to business analysts and policy experts. The visual UI also provides a user-friendly interface for creating and editing rules without writing code.
How do decision tables work?
A decision table is like a spreadsheet where columns represent different scenarios and rows represent conditions and actions. The engine evaluates conditions from top to bottom, finds matching columns, and executes the corresponding actions. This tabular format makes complex logic easy to visualize and verify.
What's the Expression Language?
DTRules includes a human-readable expression language (EL) for writing conditions and actions. Instead of code like 'if (age >= 18 && status == "active")', you write 'age >= 18 and status = "active"'. The language includes 330+ operators for arithmetic, comparisons, strings, arrays, dates, and more. You author rules in EL; `dtrules build` compiles them to postfix.
Can DTRules collect data interactively?
Yes — this is the headline feature of v1.16.0. Any decision table can run as an interactive interview: the engine executes the rules and, whenever it reaches a `collect` field that wasn't supplied, it stops and asks for it. Run it on the CLI with `dtrules run --interactive` or in the browser with `dtrules run --web`. Questions are typed (multiple_choice, ascii, number, date), and number questions can carry a lab-style reference range that flags answers High or Low. Batch execution is unchanged and pays zero overhead. Try the live SinusitisTherapy demo at dtrules-sinusitis.fly.dev.
Is DTRules suitable for high-performance applications?
Yes. The Go implementation is highly optimized for performance, with benchmarks showing 130x faster operator lookup compared to map-based approaches. DTRules has been used in production systems processing millions of eligibility determinations.
How do I test my decision tables?
DTRules supports multiple testing approaches: unit tests with expected inputs/outputs, test scenarios defined in Excel alongside your rules, and programmatic testing through the API. The deterministic execution model makes testing straightforward - the same inputs always produce the same outputs.
Where can I see DTRules in action?
The flagship example is SinusitisTherapy: a live web interview that selects an antibiotic, computes the dose with renal adjustment (Cockcroft–Gault), flags drug interactions, and explains its reasoning. Try it at dtrules-sinusitis.fly.dev. There's also an interactive poker demo on this site that uses DTRules decision tables to drive AI player behavior in Texas Hold'em.
What can the dtrules CLI do?
The CLI is a single self-contained binary with subcommands for the whole workflow: init (scaffold a project), build (Excel → XML and compile DSL → postfix), run (execute rules, batch or interactive), verify (check Excel ↔ XML consistency and self-contained references), table and edd (author via the API), sync and validate, review, docs (the full documentation is embedded in the binary), mcp, and version. Note: `dtrules compile` and `build --from-xml` were removed — use `dtrules build`.
How do I get help or report issues?
For questions and discussions, open an issue on the GitHub repository. For bugs, please include steps to reproduce, expected vs actual behavior, and your environment details. The community is responsive and contributions are welcome!
Still have questions? We're here to help.