PHPackages                             steffenbrand/dmn-decision-tables - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. steffenbrand/dmn-decision-tables

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

steffenbrand/dmn-decision-tables
================================

PHP library to programmatically create DMN decision tables.

v1.0.1(7y ago)1916.7k↓41.7%1[5 issues](https://github.com/steffenbrand/dmn-decision-tables/issues)MITPHPPHP &gt;=5.6

Since Aug 13Pushed 7y ago2 watchersCompare

[ Source](https://github.com/steffenbrand/dmn-decision-tables)[ Packagist](https://packagist.org/packages/steffenbrand/dmn-decision-tables)[ Docs](https://github.com/steffenbrand/dmn-decision-tables)[ RSS](/packages/steffenbrand-dmn-decision-tables/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

[![Build](https://camo.githubusercontent.com/25d9ccac0d32e1a5849624eb3f3b833d82776821bb8e1c7013d4c941926d2891/68747470733a2f2f7472617669732d63692e6f72672f7374656666656e6272616e642f646d6e2d6465636973696f6e2d7461626c65732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/steffenbrand/dmn-decision-tables)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/732640945376f0f460436edb18118aa0508494a5ef8cb280d8a2c7dec5774259/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7374656666656e6272616e642f646d6e2d6465636973696f6e2d7461626c65732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/steffenbrand/dmn-decision-tables/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/beccdf1d455fb3bff6775974e2d643265e5669e08850eba3dcce2ee837d70309/68747470733a2f2f706f7365722e707567782e6f72672f7374656666656e6272616e642f646d6e2d6465636973696f6e2d7461626c65732f762f737461626c65)](https://packagist.org/packages/steffenbrand/dmn-decision-tables)[![Total Downloads](https://camo.githubusercontent.com/a52bcd66f8c1181bc6a5422ab81687d62578b1c508f5ce8b460572ccda17a102/68747470733a2f2f706f7365722e707567782e6f72672f7374656666656e6272616e642f646d6e2d6465636973696f6e2d7461626c65732f646f776e6c6f616473)](https://packagist.org/packages/steffenbrand/dmn-decision-tables)[![License](https://camo.githubusercontent.com/feab1d969ab138ccd15a813cbcb5c8548b410ce99b0c09cc729e6d05658a4a55/68747470733a2f2f706f7365722e707567782e6f72672f7374656666656e6272616e642f646d6e2d6465636973696f6e2d7461626c65732f6c6963656e7365)](https://packagist.org/packages/steffenbrand/dmn-decision-tables)

DMN Decision Tables
===================

[](#dmn-decision-tables)

PHP library to programmatically create DMN decision tables

- [DMN Decision Tables on Packagist](https://packagist.org/packages/steffenbrand/dmn-decision-tables)
- [DMN Decision Tables on GitHub](https://github.com/steffenbrand/dmn-decision-tables)

Limitations
-----------

[](#limitations)

- Generated tables have been tested with [Camunda BPM platform](https://camunda.com/) and [Camunda Cloud](https://dmn.camunda.cloud/), but have **NOT** been tested with any other BPMN engine
- Only [FEEL](https://docs.camunda.org/manual/latest/reference/dmn11/feel/) and JUEL expressions have been tested yet
- Only one decision table is supported per .dmn-file
- No DRD features are supported
- IDs are generated randomly, as you can see from the examples below

How to install
--------------

[](#how-to-install)

```
composer require steffenbrand/dmn-decision-tables

```

How to use
----------

[](#how-to-use)

These examples show how to build the [Camunda Cloud](https://dmn.camunda.cloud/) example table

### Build decision table

[](#build-decision-table)

```
try {
    $decisionTable = DecisionTableBuilder::getInstance()
        ->setName('Dish')
        ->setDefinitionKey('decision')
        ->setHitPolicy(HitPolicy::UNIQUE_POLICY)
        ->addInput(new Input('Season', 'season', VariableType::STRING_TYPE))
        ->addInput(new Input('How many guests', 'guests', VariableType::INTEGER_TYPE))
        ->addOutput(new Output('Dish', 'dish', VariableType::STRING_TYPE))
        ->addRule(
            [
                new InputEntry('"Fall"', ExpressionLanguage::FEEL_LANGUAGE),
                new InputEntry(' 8')],
            [new OutputEntry('"Stew"')],
            'Less effort'
        )
        ->addRule(
            [new InputEntry('"Summer"'), new InputEntry(null)],
            [new OutputEntry('"Light Salad and a nice Steak"')],
            'Hey, why not!?'
        )
        ->build();
} catch (DmnValidationException $e) {
    // Build method validates before it creates the DecisionTable.
    // Can be disabled, so feel free to validate yourself.
    // Use the DecisionTableValidator or inject your own validator.
} catch (DmnConversionException $e) {
    // Conversion to XML might fail because of invalid expressions or whatever.
}
```

### Convert to DMN string (XML)

[](#convert-to-dmn-string-xml)

```
$decisionTable->toDMN();
```

### Save to filesystem

[](#save-to-filesystem)

```
$decisionTable->saveFile('/my/path/and/filename.dmn');
```

### What the result looks like

[](#what-the-result-looks-like)

```

          season

          guests

          "Fall"]]>

          "Spareribs"]]>

          "Winter"]]>

          "Roastbeef"]]>

          "Spring"]]>

          "Dry Aged Gourmet Steak"]]>

        Save money

          "Spring"]]>

          [5..8]]]>

          "Steak"]]>

        Less effort

          "Fall", "Winter", "Spring"]]>

          > 8]]>

          "Stew"]]>

        Hey, why not!?

          "Summer"]]>

          "Light Salad and a nice Steak"]]>

```

Try it
------

[](#try-it)

Feel free to download [generated\_with\_dmn\_decision\_tables.dmn](https://github.com/steffenbrand/dmn-decision-tables/blob/master/resources/generated_with_dmn_decision_tables.dmn)and try it in the [Camunda Cloud](https://dmn.camunda.cloud/)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~582 days

Total

2

Last Release

2618d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c0012c84bdbe5a801bef48e509ea28f5aa0359dcba13286ff6065a298f21c49?d=identicon)[steffenbrand](/maintainers/steffenbrand)

---

Top Contributors

[![steffenbrand](https://avatars.githubusercontent.com/u/5013806?v=4)](https://github.com/steffenbrand "steffenbrand (31 commits)")

---

Tags

bpmnbusiness-rulescamundadecision-tablesdmncamundabpmnDMNDecision Table

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/steffenbrand-dmn-decision-tables/health.svg)

```
[![Health](https://phpackages.com/badges/steffenbrand-dmn-decision-tables/health.svg)](https://phpackages.com/packages/steffenbrand-dmn-decision-tables)
```

###  Alternatives

[phpmentors/workflower

A BPMN 2.0 workflow engine for PHP

70652.9k4](/packages/phpmentors-workflower)[formapro/pvm

The library provides us with a frame to build a workflow or a business process such as BPMN. Could execute tasks in parallel or delayed tasks

36723.8k](/packages/formapro-pvm)[imanghafoori/php-search-replace

Smart search replace functionality for php source code

32496.5k3](/packages/imanghafoori-php-search-replace)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
