Hi my name's Scott Hebbard from Sparx Systems
In this webinar I will introduce DMN in Enterprise Architect 14.
I wanna start the webinar by asking the question what is Decision Model Notation or DMN.
A Decision is the act of applying decision logic to one or more inputs to produce an output.
DMN is an open standard published by the Object Management Group or OMG.
Enterprise Architect 14 introduces DMN support and
allows you to model the Decision Logic input data and Business Knowledge
The most familiar form of Decision Logic in DMN is called the Decision Table.
We shall examine a Decision Table in our first example.
On screen we have a Model Wizard with a Sample Pattern,
showing a Decision Input Data and Decision Table.
The webinar will demonstrate how to build a DMN diagram from already made Model Pattern
How this DMN different from Business Process Modeling.
Well we actually want a separate Decision Logic from Process Logic
This separation also allows corporations to identify parts
of the Decision Management Process that can be automated.
It helps to reduce process complexity by getting rid of lots of gates,
that often make a BPMN Diagram look messy.
The result is clean, simple and efficient decision-making process, that can be reused.
This approach also offers increased agility,
as you don't need to change process every time a minor rule changes
BPMN created a new credit limit, changing the company policy,
new legislative framework, tax bracket change or update to frequent-flyer rules.
We simply add the new rule or edit the existing one
rather than change the entire underlying process
The end result is the corporation can save time and money.
The Decision Tables modeled in Enterprise Architect are easy to use, understand and read.
The information can be easily interpreted by a business audience,
and you can generate code for a technical audience,
which can facilitate automation.
Enterprise Architect even supports Rule Validation.
Listing any errors or warnings, where rules contradict one another.
Rule Validation can help to produce a more robust decision making environment.
In this first example we model a typical finance or credit approval scenario.
We're using Enterprise Architect to help
staff at a car dealership make decisions about approving finance for a car.
The bureau or financial institution designates
each customer as having a particular risk profile.
When a customer inquires about finance.
You start by asking some questions like;
"Do you own home"? and "Have you previously banked with us"?
or "Been a customer at Acme Car Loans"?
Staff complete a questionnaire to determine a credit score
and to see if they have previously been a customer.
Two factors are then used to make the decision a "Credit score"
and "Existing customer status"
Staff at the dealership can only pre-approve loans to customers that are low-risk.
In Enterprise Architect 14 we use DMN to model
this set of business rules, execute the decision based on
applicant data and make a suitable recommendation or decision based on the input.
Open Enterprise Architect 14 and select the Perspective function,
which can limit Model Pattern options to just DMN examples.
Select "Requirements" followed by "Decision Modeling".
Enterprise Architect automatically opens a Model Wizard with
a number of ready-made DMN examples.
Select "Decision With Input Data"
an example of the pattern is displayed on the right of screen.
Select the "Create Pattern" button
to build a completed model based on an existing DMN Pattern.
When you open the DMN diagram the model contains three main components:
The Configuration Element, the Applicant Data and the Decision Table
The Configuration Element sets up the Decision and allows it to be executed.
The Decision Table represents a "Conditional logic" used to make the "Decision"
about the "Bureau call type" based on the "Applicant Data"
The "Applicant Data" represents a
given customer with their "Credit score" and "Existing Customer Status".
If we look at the Decision Table each row represents a potential decision
For example if an Applicant is not an "Existing Customer" and has a "Credit score"
less than a hundred, they are considered a high risk
and staff at the dealership will be unable to offer them a pre-approved loan
I will now demonstrate how to execute the Decision.
Select the "Simulate" tab and press "Play" to execute and simulate the Decision.
The results are displayed on screen with the supplied Applicant Data of
Credit Score of 100 and an Existing Customer status set to "true"
The Bureau has indicated, that they are a medium risk.
We can step through the simulation to better understand,
why this decision has been made.
Where a 7 has been highlighted in green
because the Existing Customer is "true" the Credit Score is between 90 and 110
Now let's alter our Applicant Data.
To do this stop the Simulation and select the 'Configure" tab
Select the button to edit the DMN Input Data...
Here we can clone the existing Applicant Data to make the appropriate changes
I find it beneficial to name the New Data Sets,
which in turn makes it easier to swap between the various sets during simulation.
Now that we have new data sets or DMN Input Data
We can rerun the simulation and get results instantly.
You can see I've used meaningful variable names for both of the Applicant Data sets.
Stop the current simulation and select the appropriate input data from the drop down list.
Press the "Save" button and execute the "Decision" using the new input data.
When we execute the simulation, we see that someone,
who is not a customer with a Credit Score of 45 is a "High risk".
Therefore we can't pre-approve the loan.
Whereas someone who is not a customer that had a Credit Score of 160 is very "Low risk"
and could be pre-approved for a car loan.
This is where Enterprise Architect 14 is so powerful
because once you model the Decision Logic.
You can run the decision countless times.
You can even import the Applicant or Import Data from a spreadsheet or CSV file
The next thing I'd like to examine in more detail is Rule Validation in Enterprise Architect 14
Enterprise Architect is capable of validating the Rule Logic employed in a Decision Table
By simply altering a bracket. The number 120 is included in two rows.
Given this scenario someone with a Credit Score of 120 and both a Medium and Low risk
The "U" at the top of the Decision Table indicates,
that the table can only produce a single unique result.
So there is a consistency error between rows 2 & 3.
When we validate the Decision Table,
Enterprise Architect clearly indicates a consistency violation
and provides feedback to help rectify the problem.
Once I make the appropriate changes and
validate again Enterprise Architect states there are no warnings or errors.
You can use Enterprise Architect to validate Decision Rules,
eliminating logical and consistency errors.
As DMN is based on an open standard there are lots of resources on the web
for learning about Decision Tables and understanding how logic works.
From the Model Wizard select "Decision with BKM.
Previously we indicated the Credit Score was calculated using a questionnaire.
Let's use Enterprise Architect to calculate the Credit Score using a series of decisions.
Our first applicant is married, employed and 40 years of age.
We take a look at the Decision Table
The "C+" essentially calculates a cumulative score on each row that receives a hit.
This might make more sense, when I step through the code.
When we add 43 + 45 + 45 it gives us a Credit Score of 133
Let's now take a look at a different example.
From the drop-down list I'm going to select a young single unemployed person
and rerun the simulation.
If I step through the code, this time they get 72.
the 72 is calculated by adding 32 + 25 + 15.
This particular Credit Score is calculated
using Marital status, Age and Employment status.
The idea could easily be extended to cover everything.
In a standard loan application from Home ownership to Loan Defaults and the
and the amount of time you've been in your Current Job.
We have seen how DMN can be modeled to make decisions
about loan approval using numbers and
financial rules listed in a Decision Table.
Enterprise Architect is even capable of validating these rules.
The next example we'll look at string manipulation to
demonstrate the added flexibility of DMN in Enterprise Architect 14
In our 2rd example we'll examine a decision being used by video streaming service.
The EA model produces a list of suitable movies based on a given genre and rating.
The example uses the Australian rating system
of PG parental guidance and M for Mature audiences
and can be easily modified to cater for a
different rating system.
Once again we can use a Model Wizard to create our DMN Diagram
for selecting movies for a video streaming service.
The Model Pattern provides the description of the search
consists of a genre such as fantasy or sci-fi and
a movie classification that might be PG, G or M for Mature audiences.
The Model Pattern describes the various Decision Tables and hit policies.
However rather than returning a numeric value they return a list of strings.
If we open the DMN List Example Diagram.
You can see a hierarchical structure,
where the results depend on two or more decisions being made.
Double click the Configuration Artifact to open the DMN Simulation window.
you'll see that "My search" is defined as all movies with a rating of PG
that exists in the genre of fantasy.
Now let's take a look at our two different Decision Tables.
The first has 10 popular movies taken from an internet service such as IMDB.
clearly listing theirs genre; Avatar is fantasy, Titanic is a drama
and Star Wars is an adventure.
The second Decision Table obtained from the standards board
lists all of the ratings for each movie.
For example Jurassic World is M for Mature audiences.
"My Search" is clearly defined as PG and Fantasy
and it's listed on the diagram.
One Decision will pick films based on ratings
while the other Decision picks films based on genre.
The final Decision Logic finds the intersect of these two lists.
If we run the simulation the results will be displayed on screen
Select the Simulate tab and the results are displayed as "Harry Potter".
Then "Beauty and the Beast"
Now let's step through the simulation to understand the result.
The first step highlights "Avatar", "Harry Potter" and
"Beauty and the Beast" in the fantasy genre.
The next step shows "Harry Potter",
"Frozen" and "Beauty and the Beast" as being rated PG.
Given the list small it's very easy to see the intersect between the two.
However this might not be so easy if you're matching 100,000 customer records.
Finally we get the result in "blue" at the top of the hierarchy.
Now I'd like to run a 2rd search using different DMN Input Data.
Once again select the "Configure" tab
and press a button to edit the "Input Data"
Climb the existing data and give it a meaningful variable name
such as "Mature".
Use a drop-down list to select all "Mature" movies in the "Action" genre.
Save the new input data and then rerun the simulation.
You run the simulation using the "Simulate" tab.
The end result is; "Jurassic world", "The Avengers",
"Furious 7" and "Transformers".
We can step through the simulation to see how the results were obtained.
All of the "Action" movies are highlighted in green.
If we look at the next step -
all of the "Mature" movies are also highlighted in green.
Using the examples shown in this webinar, you can start to build any
number of powerful Decision Models that cater for your own corporate needs.
To provide a brief summary today we've looked at Decision Model and Notation in
Enterprise Architect 14
We had a look at how DMN can be used to automate decision-making.
The two examples we looked at were a finance example and an
example where you're conducting a search for movies using a video streaming service.
Both of these models helped to reduce complexity.
And demonstrated a number of different Decision Tables
and showed some different hit policies.
There are a number of alternative hit policies which you can investigate after the webinar
Hopefully I Illustrated how this technology can be used by both a
business and a technical audience.
In future webinars we can look at some of the cogeneration capabilities,
that are more relevant to a technical audience.
in this particular example we use Rule Validation to show
when two rules contradicted one another.
Rule Validation is an important part of DMN in Enterprise Architect 14
For more information on Enterprise Architect 14
Visit www.sparxsystems.com