7. Exploring Canvas & Decisions¶
In this section, we will import an existing DMN project into BAMOE Canvas and explore its decision models and automation capabilities.
7.1 Value of DMN Automation¶
- Consistency: Ensures uniform application of eligibility criteria across all applications.
- Efficiency: Rapidly processes applications, reducing manual workload.
- Flexibility: Allows easy updates to decision logic without changing the underlying process.
- Transparency: Provides clear decision rationale, aiding in regulatory compliance.
- Scalability: Handles increasing application volumes without proportional increase in resources.
7.2 Importing DMN Projects into Canvas¶
To start, let's import a DMN file into Canvas. We will use a credit card eligibility use case to illustrate this process.
- Open Canvas in your browser.
- To import the DMN file, in Canvas go to the Import menu and select "From URL".
- Copy and paste the following link and click Import:
7.3 Credit Card Eligibility DMN Model¶
This DMN (Decision Model and Notation) model automates the initial eligibility assessment for credit card applications.
It evaluates applicant information to determine whether an application should be automatically approved, rejected, or sent for manual review.
7.3.1 Key Elements¶
- Input Node: Applicant information (age, credit score, annual income, student status)
- Decision Nodes:
- Eligibility Score Calculation: Assigns a score based on applicant criteria
- Determine Eligibility: Interprets the score to make a final decision
- Output: Eligibility result (Approved, Rejected, or Manual Review)
7.4 Exploring the Decision Model¶
-
Click on the Data Types tab. In it, you can see the
Applicant
type, which includes the attributes: age (Number), creditScore (Number), annualIncome (Number), and isStudent (Boolean). -
Now, click on the
Editor
tab and let's check the decision nodes. Click on theEligibility Score Calculation
node and observe it is of type Number and contains a decision table for calculating the eligibility score based on the applicant's criteria. - Next, check the
Determine Eligibility
decision node, which is of type String and uses a FEEL expression to determine the eligibility result based on the calculated score.
7.5 Running the Decision¶
-
Click on the Run button to see the form that was automatically generated on the right side of the screen.
-
Try out the decision using the test scenarios below.
Test Scenarios
Some examples of input and output data that can validate the decision:
Is Student | Annual Income | Credit Score | Age | Expected Output |
---|---|---|---|---|
false | 30000 | 700 | 17 | Rejected |
false | 40000 | 500 | 25 | Manual Review |
false | 60000 | 720 | 30 | Approved |
true | 5000 | 600 | 19 | Approved |
false | 80000 | 650 | 45 | Approved |
7.6 Using the Dev Deployment¶
7.6.1 About the Dev Deployment¶
Dev deployments in BAMOE Canvas allow you to deploy Decisions to both local Kubernetes instances and remote Kubernetes/OpenShift environments for development purposes.
With it, you can deploy all Decisions within a project. After a short deployment process, you will be able to access a web application provided by BAMOE Canvas for testing and interacting with your Decisions. This web application includes a form similar to the one you used when running a decision in Canvas. Along with the form, it also provides access to the Swagger UI with the Decisions' API information.
Tip
Dev deployments are immutable, meaning if you need to make changes or if an error occurs, you must create a new deployment. Dev deployments can be easily managed and deleted from the Dev deployments dropdown.
7.6.2 Steps to Deploy¶
- With the decision model opened, click on deploy.
-
In the pop-up that opens up, choose the option "Kogito Quarkus Blank App" for "Choose your deployment option".
-
Check the checkbox for "Whether to deploy the DMN Form Webapp as a sidecar container or not".
- Click on confirm.
-
Click on "Dev Deployments" on the top menu bar to show the deployment status.
-
When available (shows a green check), click on it to open the deployed service on a new page.
A new browser tab will open on a URL similar to this: https://dev-deployment-yliell9512.apps.sandbox-m2.ll9k.p1.openshiftapps.com/form-webapp/#/form/Credit%20Card%20Eligibility%20Validation
, showing an automatically generated form.
!!! Note: Dev deployments are intended to be used for development purposes only, so users should not use the deployed services in production or for any type of business-critical workloads.
7.6.3 Testing the REST APIs¶
After opening the deployed service by opening the service URL, append /q/swagger-ui
to the URL to access the APIs.
This is based on OpenAPI. You can access the OpenAPI file by opening /q/openapi
.
7.6.3.1 Evaluating a Decision using REST¶
Let's try using the POST endpoint available in swagger to fire a decision.
-
Access the swagger ui in the deployed decision service. Locate and click on the endpoint: POST
/Credit Card Eligibility Validation
-
Click on edit to use the input:
- Observe the output, which should be similar to:
Awesome!! You've successfully imported and explored a DMN project in Canvas. Now that you've seen how to model and test decisions.