Documente Academic
Documente Profesional
Documente Cultură
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
Version 1.0
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
Introduction
Business logic (i.e. business rules) can be presented visually in different forms. One of a popular ways is called
Decision Table. This is a tabular form consists of all of combinations between conditions and actions (or
conclusions). The benefit of using Decision Table is that many people understands it very well, it structures and
organizes business rules based on a higher level scenario or decision (i.e. question to be answered).
Horizontal
Inputs
Condition
Condition
Outputs
Condition
Action
Action
Rule
Vertical
Condition
Inputs
Condition
Condition
Outputs
Action
Action
Rule
Either ways, consider the conditions as the input of a decision and the actions as the output of the decision. And
in a Decision Table you map between combinations of inputs to outputs.
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
Simple Example
Lets consider a simple story. You are purchasing a book from an online store and you received the book after a
while. Now based on your experience you may want to:
1. Refer to a friend
2. Write a complaint
3. Share your positive feedback on social media
As you can see now you have a list of actions based on your experiences for:
1. How was your online ordering system experience? (Awesome/OK/Disaster)
2. Was book delivered on time? (Yes/No)
3. Was delivered book in original condition? (Yes/NO)
Now lets see how we can model scenario as a decision table. In this example what is the question the Decision
Table should answer?
So based on this formula, we have: Total Rules = [3 values] x [2 values] x [2 values] = 12 combinations.
Ordering
Experience
Delivery
On time?
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
Delivered
Condition
Refer
To a
Friend
Write
Complaint
Share
Positive
Feedback
FlexRule
Flexible Software Made Easy
1
2
3
4
5
6
7
8
9
10
11
12
Ordering
Experience
Delivery
On time?
Delivered
Condition
Awesome
Awesome
Awesome
Awesome
OK
OK
OK
OK
Disaster
Disaster
Disaster
Disaster
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Refer
To a
Friend
Write
Complaint
Share
Positive
Feedback
For example:
1. As you see in the above table, condition column for Ordering Experience has 3 possible values:
Awesome, OK and Disaster. By dividing 12 (total numbers of rules) to 3 (numbers of possible values), we
fill 4 times of each value under the first column.
2. Then we pick the next column Delivery on Time which has 2 values, and we divide result of the
previous step (4) to 2. Which means we fill 2 of each value (true/false).
3. And least, we divide (2) from last step, and divide by numbers of values for Delivered condition which
is 2 and as the result, we fill 1 time for each value on this column.
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
1
2
3
4
5
6
7
8
9
10
11
12
Ordering
Experience
Delivery
On time?
Delivered
Condition
Awesome
Awesome
Awesome
Awesome
OK
OK
OK
OK
Disaster
Disaster
Disaster
Disaster
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Refer
To a
Friend
Write
Complaint
Share
Positive
Feedback
As you see now you take decision based on the mix of each conditions on each row, what actions should be
taken. Thats why it is called a Decision Table.
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
Simple Values:
Each cell may have a simple value which can be numeric, string, date time, Boolean (true/false). By default if
only value is used in a cell, the equality operator is considers as the binding operator between the value and the
column condition.
For our example, in the A4 cell true is added as the input value of Eligible for Base Days which makes the
binding operator to equal (i.e. == , eq).
As you see in the above example, the conditions (inputs) are in the green column. And there are values in the
input cells that contains operators e.g. < or > or >= so in this example binding operator between the column
condition and the value is not simply equal but the one that is explicitly used in the input value.
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
Range Values:
In some more other scenario you can use a range expression as the input value.
As you see in this example cell B5 has a value of [15; 30) which indicates a range value. Which in this example
can be read as Years of Service is between 15 and 30 excluding 30.
For excluding the lower boundary of range you can use ( and for excluding the upper boundary of range use ).
For inclusion values use [ and ] for lower and upper boundary of range.
Empty Values:
When in a rule, a condition is not participating then leave the cell value empty. For example, in previous picture,
in rule number 5, Age is left empty. What that means is that that rules only has one condition which is Years of
Service.
Value of each element can be references with $ prefix in the column. I.e. $1 refers to 2 and $2 refers to 4.
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
In the multi-value-cell (List Values) there is no default binding operator. However if existence of a value inside
the list of values need to be tested, the in operator can be used.
In the above example, the B5 condition can be read is Years of Service is equal to either of 2 or 4. What that
means is employee will get 1 extra days leave on 2nd and 4th year of service.
Negate Values:
If the condition in a rule should be used as a negative condition, then not: should be used as the cell value
prefix.
For example in the bellow decision table to calculate the annual leave of an employee, the B7 input value is
negated. Which means is not greater or equal to 10.
Expression Values:
Sometimes, the input values are not just simple values but they are result of an evaluation of an expression
which can reference a variable, or can call a method or access a property of object. In these cases a colon :
should be used as the cell prefix.
Simple Values
Values with Operators
Empty Values
Expression Values
List Values (Mutli-Value) without in operator
Which their behaviour are very similar to the input (condition) values out their effects are in the action parts or
output values of the decisions.
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
Please note, the default binding operator in action is assign or set operator which sets an output parameter to a
value. So for example once no operator is used in an output cell, the assign will be used. In the previous example
in C7 cell number 5 is entered in Eligibility Annual Leave (days) cell which means it sets the numbers of days
to 5.
Hit Behaviour
Horizontal Decision Tables are being executed, from top to bottom and left to right. Rules on the top of table
has higher priority on execution.
A Decision Table can be:
1. Single hit: only one rule can meet the criteria for a set of values
2. Multihit: Multiple rules can be activated for a set of values
In Decision Table when Multihit behaviour is used, there are some standard aggregate functions that can be
used:
1.
2.
3.
4.
5.
Collect
Sum
Min
Max
Average
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
These behaviour are discouraged to be used on some standards i.e. Decision Model and Notation (DMN). If you
follow does standards, you should avoid override the priority and grouping rules.
Execution Behaviour
When a rules conditions are satisfied with a set of values, the action of the rules will be executes which can be:
1.
2.
3.
4.
5.
In C7 cell number 5 is entered in Eligibility Annual Leave (days) cell which means it sets the numbers of days
to 5.
Online Resources
Here are couple of online resources on Decision Table:
1. Learning Decision Table: http://wiki.flexrule.com/index.php?title=Decision_table
2. Modeling Business Policies: http://www.flexrule.com/archives/decision-model-and-notation-policyexample/
3. Validation (conflicts): http://www.flexrule.com/archives/business-rule-conflict/
4. Aggregation functions: http://www.flexrule.com/archives/decision-table-aggregation/
5. And more at http://www.flexrule.com/archives/category/decision-table/
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia
FlexRule
Flexible Software Made Easy
FlexRule
Flexible Softw are Made Easy
Pliant Framework
info@pliantframework.com
www.pliantframework.com
+61-399883994
P.O. Box 1024, Mitcham North, VIC 3132, Australia