Skip to main content

DMN implementation with ruly rule engine

Project description

Ruly-DMN

ruly-dmn is a python package that offers a limited implementation of the DMN standard, with additional features. It relies on the ruly rule engine to make decisions and derive new rules. It can be used as a library or as a command line tool.

The package assumes that the DMN diagrams are defined as XML files, in the format specified by the Camunda modeler. The recommended workflow is to use the Camunda modeler to create diagrams and initial decision tables and then pass them to functions in this package, so it can make decisions or derive new rules. See the examples directory for examples of working DMN files that can both be opened in the Camunda modeler and passed to the functions of this package.

The current limitations, in regard to the complete DMN standard:

  • only available hit policy are unique, first,
  • there are no constraints on enumerated variables when user is entering new rules
  • only one output column in decision tables is allowed
  • only available variable comparision (when making decisions) is for operators equals, greater, greater or equal, less and less or equal
  • visual diagrams are not taken into account when creating rule engine rules, only decision tables
  • the package functions are not guarenteed to work if the DMN file is incorrect
  • S-Feel and other code evaluations in rules are not supported

Installation

To install, call:

pip install ruly-dmn

Usage

When the package is installed, it can be used either by importing its modules (see documentation for more details), or by calling ruly-dmn in command line. Alternatively, python -m ruly_dmn.main may be used instead of the command line tool.

After installation, it should be possible to call ruly-dmn with one of the DMN diagrams in the example directories, i.e.:

ruly-dmn -o o.dmn examples/example1/diagram.dmn Beverage Season="Spring"

Which should output Beverage = Pinot Noir. The tool also may create new rules and, if it does, these rules should be written in o.dmn file. For more information on how the command line tool works, call ruly-dmn --help

Development environment

To install development dependencies, call

pip install -r requirements.txt

This will, among other packages, install doit, which is ruly-dmn's build tool. Use this tool to perform various actions like testing, building documentation, linting check, etc. For the list of all available tasks, call:

doit list

Contributing

Feel free to post any issues - bugs, feature requests, etc. Do not send pull requests before an issue for the problem it solves is created. When sending pull requests, please reference the issue(s) it attempts to solve and, after the review process, it will be accepted. Make sure that the updated changes reflect on the documentation and tests, so they're not left in an inconsistent state.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruly-dmn-0.0.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ruly_dmn-0.0.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file ruly-dmn-0.0.3.tar.gz.

File metadata

  • Download URL: ruly-dmn-0.0.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.1

File hashes

Hashes for ruly-dmn-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3335027cf00f2981bcdd4ab1c232e3e71dfc96d412808ab87542bef93e8deb52
MD5 4f8bd54f23985f7419710fd73a4c05c9
BLAKE2b-256 ef0300f86b7cebc149a42c630f8ba23cd94b9afa7a42c88df39c34f514753296

See more details on using hashes here.

File details

Details for the file ruly_dmn-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ruly_dmn-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.1

File hashes

Hashes for ruly_dmn-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 336a3cd71b664053fcbe7a7c4e2b4e7171f1246b543ccee70da65db912cb44ce
MD5 d0e56718be7f6d177932bdc9bbec0ce6
BLAKE2b-256 6f9c774434424053500c4042db0544b623c0274a348ef92e981f916638e1cd92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page