Decision models provide a common notation that is easily understandable by all business users. The business analysts who need to design initial decision requirements, the technical developers who are responsible for automating the decisions in processes and business people who will monitor and manage these decisions are all targets of this mechanism. Emakin decision model is based on DMN standards which is published by Object Management Group.
A decision is the act of determining an output value with a logic that is defined by a number of input values. This decision logic may include one or more business knowledge models which encapsulate business know-how's in the form of business rules, analytic models, or other formalism. Authorities may also be defined for decisions or business knowledge models, which might be (for example) domain experts who are responsible for defining or maintaining them, or source documents from which business knowledge models are derived, or sets of test cases with which the decisions must be consistent. These are called knowledge sources.
Decision Model
The basic structure can be modeled in a graphical language as follows:
Decision inputs may be input data, or the outputs of other decisions. If the inputs of a decision Decision1 include the output of another decision Decision2, Decision1 “requires” Decision2. Decisions may therefore be connected in a network called a decision model graph.
A simple example of decision model with only two decisions is shown below:
In this example "Decision2" requires the "Input Data2" input; similarly "Decision1" requires "Input Data 1" and "Decision 2" therefore "Input Data 2" also is required for "Decision 1".
Model Notation
Notation | Element | Description |
---|---|---|
A decision denotes the act of determining an output from a number of inputs, using decision logic which may reference one or more business knowledge models. | ||
Business Knowledge Model | A business knowledge model denotes a function encapsulating business knowledge, e.g., as business rules, a decision table, or an analytic model. | |
Input Data | An input data element denotes information used as an input by one or more decisions. When enclosed within a knowledge model, it denotes the parameters to the knowledge model. | |
Knowledge Source | A knowledge source denotes an authority for a business knowledge, model or decision. |
Decision Model Constructs
Input Data
Input data specifies the requirements for other elements and has the following properties:
Name
Name of the textual description of input data.
Variable Name
Name of the input to be referred in other elements.
Variable Type
Optional type of input. (i.e. string, number, date, any..)
Allowed Values
Expression of acceptable range of input data which can be an enumeration of strings ("A","B","C") or a number range (1...50). If the input is not in the allowed range, InputNotAllowed exception is thrown.
Decision
Business Knowledge Model
Business knowledge models are mathematical formulations used to apply referenced documents. BKM functions are written in FEEL syntax and an example of PMT (calculates the payment for a loan) function can be defined as a BKM function.
(amount * rate / 12) / (1 – (1 + rate / 12) ** -term)
Business knowledge model has following properties:
Name
Name of a textual description of the decision.
Variable Name
Name of a result to be referred in other elements.
Variable Type
Optional type of a result.
Feel
For decision logic modeling, there is a language called FEEL for defining and assembling decision tables, calculations, if/then/else logic, simple data structures. Please see the FEEL reference for more details.
Decision Table
Decision table is a logical expression for decision elements in the model. Please refer to the Decision Table for more details.
Executing Decisions
Decisions can be called as a "decision service" from scripting environment and also can be called from emakin rest service.
Scripting Environment
To call a decision from scripting calling, convention is:
var result = $Decisions.<DecisionName>( inputData );
DecisionName denotes the name of a decision in the graph.
InputData can be a javascript object or an xml data. Also, combining xml data and JSON objects is supported.
Please note that if the decision has only one output expression, the result is a direct value of the result output. If the decision has more than one output expression, then the result is always a javascript object and output expressions are properties of this result object.
Javascript Object Example
var result = $Decisions.MyDecision({ Product : 'Candy', Units : 30 });
Xml Data Example
var result = $Decisions.MyDecision( $Xml.SelectSingle('Order') );
Please refer to the scripting reference for more details and examples.
Rest Service
Please refer to the rest service documentation for more details.