This lab introduces you to the deployment of an existing Decision Model and Notation (DMN) and the validation of its decisions.
-
Explore an existing DMN file
-
Test the DMN file
-
Deploy the existing DMN project using BAMOE Canvas
-
Test the deployed DMN
Prerequisites
Instructions for both can be found within this documentation, links on the left.
Examine the Existing DMN Diagram
The following example describes an insurance price calculator based on an applicant’s age and accident history. You can check the DMN model at GitHub.
This example consists of a simple DMN model, which is represented by the following diagram:
In this decision diagram, the applicant’s age and accident history are the required inputs for the decision node "Insurance Total Price". This node has a simple decision table that can be checked below:
The DMN decision table includes a hit policy
, inputs
columns, and outputs
columns. In this example, the hit policy
is U
, which means Unique
, therefore only one input rule should be matched per time. The inputs
are Age
and had previous incidents
and the combination of both creates a rule. The result of this rule is the outputs
column, which in this case is the "Insurance Total Price".
The conditions for the Age
input are defined using the Friendly Enough Expression Language (FEEL).
Import the DMN File into BAMOE Canvas
In this section, you will import the GitHub repository to BAMOE Canvas directly.
-
Under Import </> From URL copy and paste the following link and click Import:
https://raw.githubusercontent.com/bamoe/bamoe-docs-source-code-examples/9.1.x/dmn/insurance-pricing.dmn
-
Once the project is imported, you will see the DMN Editor with the insurance-pricing DMN model displayed. If, instead of pointing to a particular DMN, you pointed to an entire project, any DMN/BPMN models associated with it would be able to be viewed/edited within BAMOE Canvas.
-
You can then click the Run button to get this DMN running within the browser session itself.
NoteIf you’re not connected to Extended Services, a modal will open showing how to setup it in your local environment.
-
This will have a section of the browser turn into a form, and you can run the model right there by modifying the checkbox based on the boolean of
had previous incidents
and setting anAge
based on the data type being a number.
Deploy
In this section, you will use BAMOE Canvas to deploy your DMN model to a Kubernetes cluster.
Setup your credentials
-
The first step is to connect to your Kubernetes cluster. To do it, click on (1) to open the "Connected accounts" modal, and click on "Connect to an account" (2) to setup a new account.
-
To deploy a DMN model, BAMOE Canvas gives you the option to connect to a Kubernetes cluster or to OpenShift, which is a hybrid cloud platform offered by Red Hat. For this example, we’ll use a local Kubernetes cluster, but in production, you may want to use your own internal Kubernetes. To continue, click on "Kubernetes" (1).
NoteIf you’re not connected to Extended Services, an additional modal will open showing how to setup it in your local environment. Click on "Setup" (1) and follow the instructions to continue with the Kubernetes login.
-
In the "Connect to Kubernetes" modal, add your Kubernetes cluster information. If you want to create a local cluster, you can click on "Configure a new local Kubernetes cluster through the guided wizard" (1) and follow the instructions. To continue, click on "Connect" (2).
Deploy your DMN model
-
After you’ve setup your credentials click on "Deploy" (1) and click on the DMN model name (2).
-
Your new deployment will appear in the "Dev Deployments" (1) dropdown. It will take about 30 seconds to be ready, and a green check will appear. Click on your deployment (2).
-
A new window will appear with the equivalent form of your DMN. You can share the deployed URL with everyone who has access to your cluster.