You are on page 1of 20

DECISION RULES

What are Decision Rules and how


are they useful?

Decision Rules define computations and


comparisons that may cause processing to
continue along one path or another

Decision Rules are categorized into:

When Condition
Decision Tree
Decision Table
Map Value

WHEN RULE(Rule-ObjWhen)

When evaluates a Boolean logical statement


involving values of properties, to return a
value of true or false.
E.g. : a when condition rule can test whether
an amount is greater than zero or a date is
in the future.
Can be referenced from activity rules, flow
rules

Look-N-Feel of When Rule:

Select from one of the standard conditions available


Alternatively, you may use the expression builder to create
your own expression
Note: When Conditions must evaluate to True or False

Allows logic statements


Specify logic that will be used to return a result of
True

Logic
Statement

Use a Fork shape to represent a When Condition in a flow


Multiple When connectors can branch from a Fork shape
When connectors are evaluated in sequence based on the Likelihood attribute
Evaluation stops at the first When connector that is True

Else connectors

Used when no When connectors evaluate


Whento True
Is best practice to include an Else connector with every Fork shape

Condition

Sequence of
evaluation

Fork Shape

When
connector
Else
connector

DECISION TREE
(Rule-Declare-DecisionTree)
Decision

Tree uses if/then logic to calculate a


value in a user friendly format based on rows of
property values, computations, and
comparisons.
Rules of these types can reference decision tree
rules:

In a flow rule, you can reference a decision tree rule


in a decision task, identified by the Decision
shape .
In an activity, you can evaluate a decision tree using
the Property-Map-DecisionTree method.
A Declare Expression rule can call a decision tree
rule.

Look-N-Feel of a Decision Tree:

DECISION TABLE
(Rule-Declare-DecisionTable)

A decision table is a rule defining a series of tests


performed on property values to allow an
automated decision.
Rules of these types can reference decision table
rules:
In

a flow rule, you can reference a decision table rule in a


decision task, identified by the Decision shape .
In an activity, you can evaluate a decision table using the
Property-Map-DecisionTable method.
A Declare Expression rule can call a decision table rule.

Look-N-Feel of a Decision Table:

MAP VALUE
(Rule-Obj-MapValue)

A map value rule is a rule that converts one or


two input values, such as latitude and longitude
numbers, into a calculated result value, such as a
city name. The rule uses ranges for the input
value or values and a matrix to look up the result.
Rules of five types can reference map value rules:
In a flow rule, you can reference a map value rule in a
decision task, identified by the Decision shape.
In an activity, you can evaluate a map value rule using
the Property-Map-Value ( Where you have only row input)
or Property-Map-ValuePair( When you have both row and
column inputs ).
A Declare Expression rule can call a map value rule.
A map value rule can call another map value rule.

Look-N-Feel of a Map Value:

How to Use Expression


Builder?

Using this expression


builder we can find all
ready existing functions
in libraries.

Incorporating Decision Shape:

Drop-down in
Decision shape
allows you to
choose one of three
different decision
rules

When to use Decision Tree


?
Decision Tree accepts one input property
value, but can evaluate numerous
properties
Best used for complex if/then/else
statements.
If you're making decisions on series of data
that are different from one branch to the
next, use decision tree.

When to use Map Value ?

Map Value can convert one or two property


values into a single result.

For computations based on ranges.

If you're making decisions on the basis of


only 1 or 2 values, then use MapValue.

When to use Decision


Table ?
Decision Table can convert multiple
property values into a range of return
values
Based on same property inputs with varying
values.
If you're making decisions against the same
data element, use decision table.

When to use When rule ?


When evaluates relationship among one or
more property values and returns true or
false.
Based on simple if/then/else constructs
If you want to get a Boolean returned, or
when your decision employs a lot of
complexity but doesn't need to be applied
to a lot of cases, consider using a When
rule.

THANK YOU

You might also like