Ready to create a decision model?
Ever leave the house and wish you’d better prepared for the weather?
Let’s create a process application to fix that. When prompted, you input the temperature and rain forecast, and the application decides whether you should bring:
-
An umbrella, for warm and rainy weather
-
A raincoat, for cold and rainy weather
-
An overcoat, for cold and dry weather
-
Nothing, for warm and dry weather
Using this example, let’s explore the entire decision model development life cycle—from creating a decision model, defining its decision logic, activating it on the DMN server, and using a decision service in a process.
Create a Simple Application
First, let’s create an application for the decision. Its process starts with a web form, which has two input fields where you enter temperature and rain forecast numbers. It then uses a decision element to call the decision service. Lastly, a human task element displays the decision result, which tells you what to bring for the day based on the weather.
Create a Decision Model
A decision model does what its name implies: it lets you define how decisions will work. It contains a collection of decisions, input data, and other definitions.
Add Decisions
Let’s set up our decision model framework. In Decision Model and Notation (DMN), a decision model answers a central question. This model answers the question: what to bring to be prepared for the weather?
Define Input
It’s hard to make a good decision without input (or data). For our “What to Bring for the Weather” example, the input will be two numbers: temperature and rain percent forecasts. Let’s set up their definitions.
Model Decision Logic
Now let’s change the empty logic of the decisions. You can configure decision logic in a variety of ways, but here you’ll create a Boolean expression, an if-then-else expression, and a decision table.
Test Your Decisions
Verify that the model produces the results you want by testing it with input values.
Create a Service
After you complete and test the decision logic, create a RESTful service to communicate with Process. The decision service specifies the decision and input data you want to expose.
Activate a Decision Snapshot
To use a decision model, you must create a snapshot of it and activate the snapshot on the DMN server.
Use the Decision in Your Application
Now let’s use your activated decision snapshot in a process within an application.