Evaluating a Decision
To evaluate a deployed decision, reference it by id or a combination of key and version. If a key is used but no version is specified then the latest version of decision definition with the given key is evaluated.The Decision Key
The key of a decision definition is specified by theid attribute of the
decision element in the DMN XML. The different naming is related to the
Versioning of Decisions. Since a key can reference multiple versions of a
decision definition, the id specifies exactly one version.
Passing Data
A decision may reference one or more variables. For example, a variable can be referenced in an input expression or an input entry of a decision table. The variables are passed to the decision service as key-value pairs. Each pair specifies the name and the value of a variable. For more information on the different expressions see the DMN 1.3 reference.Authorizations for Evaluating Decisions
The user needs the permissionCREATE_INSTANCE on the resource
DECISION_DEFINITION to evaluate decisions. The resource id of the
authorization is the decision definition key.
For more information about authorizations please refer to the Authorization
Service section.
Working with the Decision Result
The result of an evaluation is called decision result. The decision result is a complex object of typeDmnDecisionResult. Think of it as a list of key-value pairs.
If the decision is implemented as decision table then each entry in the list represents one matched rule. The output entries of this
rule are represented by the key-value pairs. The key of a pair is specified by
the name of the output.
Instead, if the decision is implemented as decision literal expression then the list contains only one entry. This entry represents the expression value and is mapped by the variable name.
The decision result provides methods from interface List<Map<String, Object>> and some convenience methods.
DmnDecisionResult.
History of Evaluated Decisions
When a decision is evaluated, a new history entry of typeHistoricDecisionInstance is created which contains the inputs and outputs of
the decision. The history can be queried by the history service.