Skip to content

Repository files navigation

dmn-elements

BuildCoverage Status

Executable decision elements based on DMN 1.3, including the DMN 1.4 boxed expressions (conditional, filter, for, some, every) and the DMN 1.5 item definition type constraints through a shipped dmn-moddle grammar extension.

Walks the decision requirement graph (DRG) and evaluates decisions — decision tables and literal expressions — standing on maintained upstream pieces:

  • dmn-moddle parses DMN XML (host-side, dev dependency)
  • feelin evaluates FEEL expressions and unary tests (peer dependency)

Sibling of bpmn-elements, sharing its idiom: isomorphic, tree-shakeable, minimal runtime dependencies.

Documentation

  • APIDefinition, environment settings, and extensions
  • Examples — runnable examples

Debug

Element execution is logged through the pluggable Logger environment option — silent by default. To follow the execution tree, pass a debug-backed logger:

import Debug from 'debug';
import { Context, Definition, Environment } from 'dmn-elements';

const environment = new Environment({
  Logger(scope) {
    return {
      debug: Debug(`dmn-elements:${scope}`),
      error: Debug(`dmn-elements:error:${scope}`),
      warn: Debug(`dmn-elements:warn:${scope}`),
    };
  },
});

Run with DEBUG=dmn-elements:*:

dmn-elements:dmn:definitions <membershipDefinitions> run decision <fee>
dmn-elements:dmn:definitions <fee> requires decision <category>
dmn-elements:dmn:definitions <category> requires input data <ageInput>
dmn-elements:dmn:inputdata <ageInput> evaluate
dmn-elements:dmn:decision <category> evaluate
dmn-elements:dmn:decisiontable <categoryTable> 1 of 2 rules matched: adultRule, resolving hit policy UNIQUE
dmn-elements:dmn:definitions <category> completed
dmn-elements:dmn:definitions <fee> bound <Category> from decision <category>
dmn-elements:dmn:decision <fee> evaluate
dmn-elements:dmn:decisiontable <feeTable> 1 of 2 rules matched: adultFeeRule, resolving hit policy UNIQUE
dmn-elements:dmn:definitions <fee> completed

DMN conformance

Checked against the DMN TCK (July 2026):

  • Compliance level 2: 100% (126/126 assertions)
  • Compliance level 3: 84.7% (2852/3369)
  • Overall: 85.2% (2978/3495)

All boxed expressions of DMN 1.3 evaluate — decision tables, literal expressions, contexts, invocations, relations, lists, and function definitions — as do the DMN 1.4 additions (conditional, filter, for, some, every; their TCK cases pass in full), plus decision services, business knowledge models, item definitions, and multi-model imports. The DMN 1.5 changes are covered too: item definition type constraints (no TCK case exercises them yet) and the simplified imported input data binding. The remaining gap is dominated by FEEL edge-case semantics owned by feelin (arithmetic corner cases, instance of, temporal functions).

The full per-case report lives in scripts/tck/REPORT.md — regenerate it with npm run test:tck (it tells you how to fetch the TCK test cases on first run).

Ecosystem

  • bpmn-elements — isomorphic BPMN 2.0 execution elements, the sibling this project mirrors
  • bpmn-engine — BPMN 2.0 execution engine
  • bpmn-middleware — Express middleware exposing the engine over HTTP. Holds example to combine dmn-elements with BPMN execution engine

About

Executable decision elements based on DMN 1.3, 1.4 and 1.5

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages