Getting started
This is a quick overview of the basic functionalities of the Decision Toolkit, using copy and paste. The examples are brief and designed to help you quickly become familiar with the Decision Toolkit. For detailed explanations, refer to the chapters cited below each example.
Install examples
Decision Toolkit 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 ~/examples
For more details, refer to the chapter Saving examples.
Serve DMN™ model
Change to the directory containing the decision model example:
$ cd ~/examples/dm
Start 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:22022
Switch to another terminal and type:
$ curl -s -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%20Message
Expected 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/dm
Evaluate 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/dt
Evaluate the decision table (edt command):
$ dsntk edt dt.ctx dt.dtb
Expected result:
0.15
For more details, refer to the chapter Evaluating decision tables.
Evaluate FEEL expression
Change to the directory containing the FEEL expression example:
$ cd ~/examples/fe
Evaluate FEEL expression (efe command):
$ dsntk efe fe.ctx fe.feel
Expected result:
0.3
For more details, refer to the chapter Evaluating FEEL expressions.