https://github.com/camunda-community-hub/camunda-dmn-tester
Project to test (Camunda)-DMN Tables.
https://github.com/camunda-community-hub/camunda-dmn-tester
camunda dmn dmn-tables dmn-tester scala
Last synced: 3 months ago
JSON representation
Project to test (Camunda)-DMN Tables.
- Host: GitHub
- URL: https://github.com/camunda-community-hub/camunda-dmn-tester
- Owner: camunda-community-hub
- License: mit
- Created: 2020-09-27T15:00:05.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-05T18:45:27.000Z (10 months ago)
- Last Synced: 2025-04-07T16:42:02.490Z (6 months ago)
- Topics: camunda, dmn, dmn-tables, dmn-tester, scala
- Language: Scala
- Homepage:
- Size: 1.02 MB
- Stars: 20
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/camunda-community-hub/community)
[](https://github.com/Camunda-Community-Hub/community/blob/main/extension-lifecycle.md#incubating-)





# Camunda DMN Table Tester
A little DMN Table tester with the following Goals:
* As a developer I want to test the DMNs that I get from the Business, even not knowing the concrete rules.
* Business people can create their own tests.
* They can easily adjust the tests to the dynamic nature of DMN Tables.> This is exactly the kind of tool that as soon as I saw it, I knew it was something I was missing.
>
> I really enjoy being able to help people especially new people with modeling DMN, so I often have people sending me models to validate.
>
> This tool’s fundamental helpfulness comes first from being able to quickly catch some of the simple common errors, but also in the way it makes it easy for business users to explore the wide variety of possible ways in DMN that decisions can be modeled. This was in fact the original goal of DMN and this is a strong step towards narrowing the Business IT Gap for the standard.
>
> **Niall Deehan** Developer Relations Camunda## Version
I work at a redesign at the moment and published it > Version `> 0.15.*`.Not all features are ready in the UI (mostly the test cases).
So if you need them stay on `0.14.0`.## Usage
I wrote two blog article that explains how you can use it:* [Testing (Camunda)-DMN Tables automatically](https://pme123.medium.com/testing-camunda-dmn-tables-automatically-713497ab57e6)
* [Use the DMN Tester for Continuous Integration CI](https://pme123.medium.com/testing-camunda-dmn-tables-automatically-part-2-d3931ed38f51)
And there is a Recording from Camunda Community Summit:
* [Testing DMN Tables Automatically](https://page.camunda.com/ccs-mengelt-testing-dmn-tables-automatically)## Test Configuration

**1 Test Mode**
You can configure a DMN Table Test as:- a Unit test (the inputs are not created from evaluating the depending decisions - you define them directly)
- with all its dependent Inputs (decisions like DMN Tables or Literal Expressions).**2 Decision Id**
The id of your table - be aware this is not the name
- you only find it in the 'Edit DRD' Panel with the DMN Table Object selected.**3 Path of the DMN**
This path depends on your Docker Image (check _runDmnTester.sh_).
Example: `-v $(pwd)/dmns:/opt/docker/dmns \`
- This assumes your DMNs are in a folder _dmns_.
- So your Path would be `dmns/MyDmn.dmn`.**4 Test Inputs**
Add the following for each Input:
- Key: This is what you need in your input expressions.
- Type: The Type specified.
- Values: A comma separated list of all possible inputs.
- Null Value: If it is possible that the input may be _null_ (not required), check this box.**5 Test Variables**
You can define Variables you use in your Rules. Usually one value is enough.
## Technologies
This projects builds on cool Open Source Projects. So my thanks go to:### Shared
* [Circe](https://circe.github.io/circe/):
> Library to serialize and deserialize Json to communicate between the client and the server.
> The library works on both Scala and Scala.js.### Client
* [Laminar](https://laminar.dev)
> Native Scala.js library for building user interfaces
* [Laminar bindings for SAP ui5](https://github.com/sherpal/LaminarSAPUI5Bindings)
> Bindings that allows using Laminar with a decent Webcomponents library.### Server
* [Scala DMN](https://github.com/camunda/dmn-scala)
> An engine to execute decisions according to the DMN 1.1 specification.
* [http4s](https://http4s.org)
> Typeful, functional, streaming HTTP for Scala.
* [ZIO Config](https://zio.github.io/zio-config/)
> A functional, composable ZIO interface to configuration
* [ZIO](https://zio.dev)
> Type-safe, composable asynchronous and concurrent programming for Scala### Start Script
* [Ammonite](https://ammonite.io/#Ammonite)
> Ammonite lets you use the Scala language for scripting purposes: in the REPL, as scripts, as a library to use in existing projects, or as a standalone systems shell.
## Development
### Server
`sbt server/run`This starts the Web Server on **Port 8883**.
>This copies the client assets to the classpath of the server.
> So make sure you run `npm run build` before.
>
> Or use the client as described in the next chapter.### Client
In the sbt console: `~fastLinkJS`This creates the Javascript file from the Scala classes on the fly with every change.
In the terminal: `npm run dev`
This will watch all your changes in the client and automatically refresh your Browser Session.
This uses [Vite](https://vitejs.dev/guide/).Open in the Browser **http://localhost:5173**.
## Releasing
Just run `amm ./publish-release.sc VERSION`.Due to problems with the `"org.xerial.sbt" % "sbt-sonatype"` Plugin you have to release manually:
- https://s01.oss.sonatype.org/#stagingRepositories
- login
- check Staging Repository
- hit _close_ Button
- hit _release_ Button
> if you do not see any of the buttons or repository hit the _refresh_ Button.### Local publish
Just run `amm ./publish-release.sc VERSION-SNAPSHOT`.For now as soon as you publish a SNAPSHOT - it is always published locally.
### Docker
There are 2 Docker Images:1. The DMN Tester App:
`sbt server/docker:publishLocal` creates a Docker Image - see also next chapter.
2. The Unit Test Creator:
See its [README.md](docker/README.md)
## Try it out
There are Docker Images you can use with an example in the `demo` directory.`cd demo`
See the according [README](demo/README.md)