Getting started
This is a quick overview of the basic functionalities of the DecisionToolkit, using copy and paste. The examples are brief and designed to help you quickly become familiar with the DecisionToolkit. For detailed explanations, refer to the chapters cited below each example.
Install examples
DecisionToolkit provides a set of built-in examples ready to play with. To install the examples in, e.g., the examples subdirectory in your home directory, type:
$ dsntk exs ~/examplesFor more details, refer to the chapter Saving examples.
Serve DMN™ model
Change to the directory containing the decision model example:
$ cd ~/examples/dmStart the server (srv command):
$ dsntk srv -v -H 127.0.0.1 -D .Expected output:
Found 1 model.
Loaded 1 model.
Deployed 1 invocable.
Deployed invocable:
org/decision-toolkit/greetings/Greeting%20Message
dsntk 127.0.0.1:22022Switch to another terminal and type:
$ curl -s -w '\n' -d '{"Full Name": "Solomon L. Pollack"}' -H 'Content-Type: application/json' -X POST http://127.0.0.1:22022/evaluate/org/decision-toolkit/greetings/Greeting%20MessageExpected output:
{"data":"Hello Solomon L. Pollack"}For more details, refer to the chapter Serving DMN™ models.
Evaluate DMN™ model
Again, change to the directory containing the decision model example:
$ cd ~/examples/dmEvaluate the decision model (edm command):
$ dsntk edm dm.ctx dm.dmn -i "Greeting Message"Expected result:
"Hello Solomon L. Pollack"For more details, refer to the chapter Evaluating DMN™ models.
Evaluate decision table
Change to the directory containing the decision table example:
$ cd ~/examples/dtEvaluate the decision table (edt command):
$ dsntk edt dt.ctx dt.dtbExpected result:
0.15For more details, refer to the chapter Evaluating decision tables.
Evaluate FEEL expression
Change to the directory containing the FEEL expression example:
$ cd ~/examples/feEvaluate FEEL expression (efe command):
$ dsntk efe fe.ctx fe.feelExpected result:
0.3For more details, refer to the chapter Evaluating FEEL expressions.