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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ruly_dmn-0.0.4-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ruly_dmn-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e03fa348c37e283fcdb0f75053929ea4e4c90777cefcf55d801e40ff05061da
MD5 a2ff6989a88aefc2db4bde306135dd84
BLAKE2b-256 0340a6659529e19d69e6b5cfe97c9b3338358e24a41839813f4bee763e6280f5

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