Formal 16 06 02
Formal 16 06 02
Formal 16 06 02
__________________________________________________
OMG Document Number: formal/2016-06-02
Standard document URL: http://www.omg.org/spec/DMN/1.1
Normative Machine Consumable File(s):
http://www.omg.org/spec/DMN/20151101/dmn.xmi
http://www.omg.org/spec/DMN/20151101/dmn.xsd
_________________________________________________
Copyright © 2013, Decision Management Solutions
Copyright © 2013, Escape Velocity LLC
Copyright © 2013, Fair Isaac Corporation
Copyright © 2013, International Business Machines Corporation
Copyright © 2013, Knowledge Partners International
Copyright © 2013, KU Leuven
Copyright © 2013, Model Systems Limited
Copyright © 2013, Oracle Incorporated
Copyright © 2013, TIBCO Software Inc.
Copyright © 2016, Object Management Group, Inc.
LICENSES
The companies listed above have granted to the Object Management Group, Inc. (OMG) a nonexclusive,
royalty-free, paid up, worldwide license to copy and distribute this document and to modify this document and
distribute copies of the modified version. Each of the copyright holders listed above has agreed that no person
shall be deemed to have infringed the copyright in the included material of any such copyright holder by reason
of having used the specification set forth herein or having conformed any computer software to the
specification.
Subject to all of the terms and conditions below, the owners of the copyright in this specification hereby grant
you a fully-paid up, non-exclusive, nontransferable, perpetual, worldwide license (without the right to
sublicense), to use this specification to create and distribute software and special purpose specifications that are
based upon this specification, and to use, copy, and distribute this specification as provided under the Copyright
Act; provided that: (1) both the copyright notice identified above and this permission notice appear on any
copies of this specification; (2) the use of the specifications is for informational purposes and will not be copied
or posted on any network computer or broadcast in any media and will not be otherwise resold or transferred for
commercial purposes; and (3) no modifications are made to this specification. This limited permission
automatically terminates without notice if you breach any of these terms or conditions. Upon termination, you
will destroy immediately any copies of the specifications in your possession or control.
PATENTS
The attention of adopters is directed to the possibility that compliance with or adoption of OMG specifications
may require use of an invention covered by patent rights. OMG shall not be responsible for identifying patents
for which a license may be required by any OMG specification, or for conducting legal inquiries into the legal
validity or scope of those patents that are brought to its attention. OMG specifications are prospective and
advisory only. Prospective users are responsible for protecting themselves against liability for infringement of
patents.
GENERAL USE RESTRICTIONS
Any unauthorized use of this specification may violate copyright laws, trademark laws, and communications
regulations and statutes. This document contains information which is protected by copyright. All Rights
Reserved. No part of this work covered by copyright herein may be reproduced or used in any form or by any
means--graphic, electronic, or mechanical, including photocopying, recording, taping, or information storage
and retrieval systems--without permission of the copyright owner.
DISCLAIMER OF WARRANTY
WHILE THIS PUBLICATION IS BELIEVED TO BE ACCURATE, IT IS PROVIDED "AS IS" AND MAY
CONTAIN ERRORS OR MISPRINTS. THE OBJECT MANAGEMENT GROUP AND THE COMPANIES
LISTED ABOVE MAKE NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO
THIS PUBLICATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF TITLE OR
OWNERSHIP, IMPLIED WARRANTY OF MERCHANTABILITY OR WARRANTY OF FITNESS FOR A
PARTICULAR PURPOSE OR USE. IN NO EVENT SHALL THE OBJECT MANAGEMENT GROUP OR
ANY OF THE COMPANIES LISTED ABOVE BE LIABLE FOR ERRORS CONTAINED HEREIN OR FOR
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, RELIANCE OR COVER DAMAGES,
INCLUDING LOSS OF PROFITS, REVENUE, DATA OR USE, INCURRED BY ANY USER OR ANY
THIRD PARTY IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS
MATERIAL, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
The entire risk as to the quality and performance of software developed using this specification is borne by you.
This disclaimer of warranty constitutes an essential part of the license granted to you to use this specification.
TRADEMARKS
CORBA®, CORBA logos®, FIBO®, Financial Industry Business Ontology®, FINANCIAL INSTRUMENT
GLOBAL IDENTIFIER®, IIOP®, IMM®, Model Driven Architecture®, MDA®, Object Management
Group®, OMG®, OMG Logo®, SoaML®, SOAML®, SysML®, UAF®, Unified Modeling Language®,
UML®, UML Cube Logo®, VSIPL®, and XMI® are registered trademarks of the Object Management Group,
Inc.
For a complete list of trademarks, see: http://www.omg.org/legal/tm_list.htm. All other products or company
names mentioned are used for identification purposes only, and may be trademarks of their respective owners.
COMPLIANCE
The copyright holders listed above acknowledge that the Object Management Group (acting itself or through its
designees) is and shall at all times be the sole entity that may authorize developers, suppliers and sellers of
computer software to use certification marks, trademarks or other special designations to indicate compliance
with these materials.
Software developed under the terms of this license may claim compliance or conformance with this
specification if and only if the software compliance is of a nature fully matching the applicable compliance
points as stated in the specification. Software developed only partially matching the applicable compliance
points may claim only that the software was based on this specification, but may not claim compliance or
conformance with this specification. In the event that testing suites are implemented or approved by Object
Management Group, Inc., software developed using this specification may claim compliance or conformance
with the specification only if the software satisfactorily completes the testing suites.
1 Scope...........................................................................................................................9
2 Conformance...............................................................................................................9
2.1 Conformance Levels...................................................................................................................................................9
2.2 General Conformance Requirements.......................................................................................................................10
2.2.1 Visual Appearance............................................................................................................................................10
2.2.2 Decision Semantics...........................................................................................................................................10
2.2.3 Attributes and Model Associations...................................................................................................................10
3 References.................................................................................................................11
3.1 Normative.................................................................................................................................................................11
3.2 Non-normative..........................................................................................................................................................12
4 Additional Information.............................................................................................12
4.1 Acknowledgements...................................................................................................................................................12
4.2 IPR and Patents.........................................................................................................................................................13
4.3 Guide to the Specification........................................................................................................................................13
5 Introduction to DMN................................................................................................15
5.1 Context.....................................................................................................................................................................15
5.2 Scope and uses of DMN...........................................................................................................................................18
5.2.1 Modeling human decision-making...................................................................................................................18
5.2.2 Modeling requirements for automated decision-making..................................................................................18
5.2.3 Implementing automated decision-making.......................................................................................................19
5.2.4 Combining applications of modeling................................................................................................................19
5.3 Basic Concepts.........................................................................................................................................................20
5.3.1 Decision requirements level.............................................................................................................................20
5.3.2 Decision logic level..........................................................................................................................................22
5.3.3 Decision services..............................................................................................................................................25
8 Decision Table..........................................................................................................71
8.1 Introduction..............................................................................................................................................................71
8.2 Notation....................................................................................................................................................................74
8.2.1 Line style and color..........................................................................................................................................75
8.2.2 Table orientation...............................................................................................................................................75
8.2.3 Input expressions..............................................................................................................................................78
8.2.4 Input values.......................................................................................................................................................78
8.2.5 Information Item names, output labels, and output component names............................................................78
8.2.6 Output values....................................................................................................................................................78
8.2.7 Multiple outputs................................................................................................................................................79
8.2.8 Input entries......................................................................................................................................................80
8.2.9 Merged input entry cells...................................................................................................................................80
8.2.10 Output entry....................................................................................................................................................81
8.2.11 Hit policy........................................................................................................................................................82
8.2.12 Default output values......................................................................................................................................84
8.3 Metamodel................................................................................................................................................................84
8.3.1 Decision Table metamodel................................................................................................................................84
8.3.2 Decision Table Input and Output metamodel...................................................................................................86
8.3.3 Decision Rule metamodel.................................................................................................................................87
8.4 Examples..................................................................................................................................................................88
11 DMN Example......................................................................................................145
11.1 Introduction..........................................................................................................................................................145
11.2 The Business Process Model.................................................................................................................................145
11.3 The decision requirements level............................................................................................................................147
11.4 The decision logic level.........................................................................................................................................153
11.5 Executing the Decision Model..............................................................................................................................163
12 Exchange Formats................................................................................................165
12.1 Interchanging Incomplete Models.........................................................................................................................165
12.2 Machine Readable Files........................................................................................................................................165
12.3 XSD.......................................................................................................................................................................165
12.3.1 Document Structure.......................................................................................................................................165
12.3.2 References within the DMN XSD.................................................................................................................165
OMG Specifications
As noted, OMG specifications address middleware, modeling and vertical domain frameworks. All OMG Specifications
are available from the OMG website at:
http://www.omg.org/spec
Specifications are organized by the following categories:
Middleware Specifications
• CORBA/IIOP
• Data Distribution Services
• Specialized CORBA
Modernization Specifications
Platform Independent Model (PIM), Platform Specific Model (PSM), Interface Specifications
• CORBAServices
• CORBAFacilities
All of OMG’s formal specifications may be downloaded without charge from our website. (Products implementing OMG
specifications are available from individual suppliers.) Copies of specifications, available in PostScript and PDF format,
may be obtained from the Specifications Catalog cited above or by contacting the Object Management Group, Inc. at:
OMG Headquarters
109 Highland Avenue
Needham, MA 02494
USA
Tel: +1-781-444-0404
Fax: +1-781-444-0320
Email: pubs@omg.org
Certain OMG specifications are also available as ISO standards. Please consult http://www.iso.org
Typographical Conventions
The type styles shown below are used in this document to distinguish programming statements from ordinary English.
However, these conventions are not used in tables or headings where no distinction is necessary.
Times/Times New Roman - 10 pt.: Standard body text, table text, bullets
Helvetica/Arial – 9 or 10 pt. Bold: OMG Interface Definition Language (OMG IDL) and syntax elements.
Courier new/Courier – 10 pt. Bold: Programming Languages
Issues
The reader is encouraged to report any technical or editing issues/problems with this by completing the Issue Reporting
Form listed on the main web page http://www.omg.org, under documents, Report a Bug/Issue.
2 Conformance
2.1 Conformance Levels
Software may claim compliance or conformance with DMN 1.1 if and only if the software fully matches the applicable
compliance points as stated in the specification. Software developed only partially matching the applicable compliance
points may claim that the software was based on this specification, but may not claim compliance or conformance with
this specification.
The specification defines three levels of conformance, namely Conformance Level 1, Conformance Level 2, and
Conformance Level 3.
An implementation claiming conformance to Conformance Level 1 is not required to support Conformance Level 2 or
Conformance Level 3. An implementation claiming conformance to Conformance Level 2 is not required to support
Conformance Level 3.
An implementation claiming conformance to Conformance Level 1 SHALL comply with all of the specifications set
forth in Clauses 6 (Decision Requirements), 7 (Decision Logic), and 8 (Decision Table) of this document. An
implementation claiming conformance to Conformance Level 1 is never required to interpret expressions (modeled as an
Expression elements) in decision models. However, to the extent that an implementation claiming conformance to
Conformance Level 1 provides an interpretation to an expression, that interpretation SHALL be consistent with the
semantics of expressions as specified in Clause 7.
An implementation claiming conformance to Conformance Level 2 SHALL comply with all of the specifications set
forth in clauses 6 (Decision Requirements), 7 (Decision Logic), and 8 (Decision Table) of this document. In addition it is
required to interpret expressions in the simple expression language (S-FEEL) specified in Clause 9.
An implementation claiming conformance to Conformance Level 3 SHALL comply with all of the specifications set
forth in clauses 6 (Decision Requirements), 7 (Decision Logic), 8 (Decision Table), and 10 (Expression language) of this
document. Notice that the simple expression language that is specified in clause 9 is a subset of FEEL, and that,
therefore, an implementation claiming conformance to Conformance Level 3 can also claim conformance to
Conformance Level 2 (and to Conformance Level 1).
In addition, an implementation claiming conformance to any of the three DMN 1.1 conformance levels SHALL comply
with all of the requirements set forth in sub clause 2.2.
BPMN 2.0 - Business Process Model and Notation, version 2.0, OMG Document Number: formal/2011-01-03, January
2011
http://www.omg.org/spec/BPMN/2.0
IEEE 754 - IEEE 754-2008, IEEE Standard for Floating-Point Arithmetic, International Electrical and Electronics
Engineering Society, December, 2008
http://www.techstreet.com/ieee/searches/5835853
ISO 8601 - ISO 8601:2004, Data elements and interchange formats -- Information interchange -- Representation of
dates and times, International Organization for Standardization, 2004
http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=40874
ISO EBNF - ISO/IEC 14977:1996, Information technology -- Syntactic metalanguage -- Extended BNF, International
Organization for Standardization, 1996
http://standards.iso.org/ittf/PubliclyAvailableStandards/s026153_ISO_IEC_14977_1996(E).zip
Java - The Java Language Specification, Java SE 7 Edition, Oracle Corporation, February 2013
http://docs.oracle.com/javase/specs/jls/se7/jls7.pdf
PMML - Predictive Model Markup Language (PMML), Data Mining Group, May, 2014
http://www.dmg.org/v4-2-1/GeneralStructure.html
RFC 3986 - RFC 3986: Uniform Resource Identifier (URI): Generic Syntax. Berners-Lee, T., Fielding, R., and Masinter,
L, editors. Internet Engineering Task Force, 2005.
http://www.ietf.org/rfc/rfc3986.txt
UML - Unified Modeling Language (UML), v2.4.1, OMG Document Number formal/2011-08-05, August 2011
http://www.omg.org/spec/UML/2.4.1
XBASE - XML Base (Second Edition). Jonathan Marsh and Richard Tobin, editors. World Wide Web Consortium, 2009.
http://www.w3.org/TR/xmlbase/
XML - Extensible Markup Language (XML) 1.0 (Fifth Edition), W3C Recommendation 26 November 2008
http://www.w3.org/TR/xml/
XML Schema - XML Schema Part 2: Datatypes Second Edition, W3C Recommendation 28 October 2004
http://www.w3.org/TR/xmlschema-2/
XPath Data Model - XQuery 1.0 and XPath 2.0 Data Model (XDM) (Second Edition), W3C Recommendation 14
December 2010
http://www.w3.org/TR/xpath-datamodel/
XQuery and XPath Functions and Operators - XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition),
W3C Recommendation 14 December 2010
http://www.w3.org/TR/xpath-functions/XQuery
PRR - Production Rule Representation (PRR), Version 1.0, December 2009, OMG document number
formal/2009-12-01
http://www.omg.org/spec/PRR/1.0/
RIF - RIF production rule dialect, Ch. de Sainte Marie et al. (Eds.) , W3C Recommendation, 22 June 2010.
http://www.w3.org/TR/rif-prd/
SBVR - Semantics of Business Vocabulary and Business Rules (SBVR), V1.2, OMG document number
formal/2013-11-04, November 2013
http://www.omg.org/spec/SBVR/1.2/
SQL - ISO/IEC 9075-11:2011, Information technology -- Database languages -- SQL -- Part 11: Information and
Definition Schemas (SQL/Schemata), International Organization for Standardization, 2011
http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=5368
Xpath - XML Path Language (XPath) Version 1.0, W3C Recommendation 16 November 1999
http://www.w3.org/TR/xpath
4 Additional Information
4.1 Acknowledgements
The following companies submitted this specification:
Decision Management Solutions
Escape Velocity
FICO
International Business Machines
Oracle
The following persons were members of the core team that contributed to the content specification: Martin Chapman,
Bob Daniel, Alan Fish, Larry Goldberg, John Hall, Barbara von Halle, Gary Hallmark, Dave Ings, Christian de Sainte
Marie, James Taylor, Jan Vanthienen, Paul Vincent.
In addition, the following persons contributed valuable ideas and feedback that improved the content and the quality of
this specification: Bas Janssen, Robert Lario, Pete Rivett.
The resulting connected set of models will allow detailed modeling of the role of business rules and analytic models in
business processes, cross-validation of models, top-down process design and automation, and automatic execution of
decision-making (e.g., by a business process management system calling a decision service deployed from a business
rules management system).
Although Figure 1 shows a linkage between a business process model and a decision model for the purposes of
explaining the relationship between DMN and other standards, it must be stressed that DMN is not dependent on BPMN,
and its two levels – decision requirements and decision logic – may be used independently or in conjunction to model a
domain of decision-making without any reference to business processes (see 5.2 Scope and uses of DMN).
DMN will provide constructs spanning both decision requirements and decision logic modeling. For decision
requirements modeling, it defines the concept of a Decision Requirements Graph (DRG) comprising a set of elements
and their connection rules, and a corresponding notation: the Decision Requirements Diagram (DRD). For decision logic
modeling it provides a language called FEEL for defining and assembling decision tables, calculations, if/then/else logic,
simple data structures, and externally defined logic from Java and PMML into executable expressions with formally
First, the decision-making within the existing process might be modeled, to identify the full extent of current decision
making and the areas of business knowledge involved. This “as-is” analysis provides the baseline for process
improvement.
Next, the process might be redesigned to make the most effective use of both automated and human decision-making,
often using collaboration between the two (e.g., using automated referrals to human decision-makers, or decision support
For simplicity and generality, many of the figures in this specification show each decision as having a single associated
business knowledge model, but it should be noted that DMN does not require this to be the case. The use of business
knowledge models to encapsulate decision logic is a matter of style and methodology, and decisions may be modeled
with no associated business knowledge models, or with several.
Authorities may be defined for decisions or business knowledge models, which might be (for example) domain experts
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 (see Figure 4).
A decision is said to “require” its inputs in order to determine its output. The inputs may be input data, or the outputs of
other decisions. (In either case they may be data structures, rather than just simple data items.) 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 Requirements Graph (DRG), which may be drawn as a Decision
Requirements Diagram (DRD). A DRD shows how a set of decisions depend on each other, on input data, and on
business knowledge models. A simple example of a DRD with only two decisions is shown in Figure 5.
A decision may require multiple business knowledge models, and a business knowledge model may require multiple
other business knowledge models, as shown in Figure 6. This will allow (for example) the modeling of complex decision
logic by combining diverse areas of business knowledge, and the provision of alternative versions of decision logic for
use in different situations.
In the same way, at the decision logic level, a business knowledge model is defined using a value expression that
specifies how an output is determined from a set of inputs. In a business knowledge model, the value expression is
encapsulated as a function definition, which may be invoked from a decision's value expression. The interpretation of
business knowledge models as functions in DMN means that the combination of business knowledge models as in Figure
6 has the clear semantics of functional composition. The value expression of a business knowledge model may be
notated using a boxed function definition, as shown in Figure 8.
A business knowledge model may contain any decision logic which is capable of being represented as a function. This
will allow the import of many existing decision logic modeling standards (e.g., for business rules and analytic models)
into DMN. An important format of business knowledge, specifically supported in DMN, is the Decision Table. Such a
business knowledge model may be notated using a Decision Table, as shown in Figure 9.
In most cases, the logic of a decision is encapsulated into business knowledge models, and the value expression
associated with the decision specifies how the business knowledge models are invoked, and how the results of their
invocations are combined to compute the output of the decision. The decision’s value expression may also specify how
the output is determined from its input entirely within itself, without invoking a business knowledge model: in that case,
no business knowledge model is associated with the decision (neither at the decision requirements level nor at the
decision logic level).
An expression language for defining decision logic in DMN, covering all the above concepts, is specified fully in Clause
10. This is FEEL: the Friendly Enough Expression Language. The notation for Decision Tables is specified in detail in
Clause 8.
When the service is called, providing the input data and input decisions, it returns the output decisions.
Note that to define a decision service it is only necessary to specify the output decisions and either the input decisions or
the encapsulated decisions. The remaining attributes (the required input data, and whichever of the encapsulated or input
decisions was not specified) may then be inferred from the decision model against which the service is defined.
Alternatively, if more attributes are defined than are strictly necessary, they may be validated against the decision model.
Figure 10 shows a decision service defined against a decision model that includes three decisions. The output decisions
for this service are {Decision 1}, and the input decisions are {}, that is, the service returns the result of Decision 1 and is
not provided with the results of any external decisions. Since Decision 1 requires Decision 2, which is not provided to
the service as input, the service must also encapsulate Decision 2. Decision 3 is not required to be encapsulated. The
encapsulated decisions are therefore {Decision 1, Decision 2}. The service requires Input data 1 and Input data 2, but
not Input data 3.
Multiple decision services may be defined against the same decision model. Figure 11 shows a decision service defined
against the same decision model, whose output decisions are {Decision 1} and whose input decisions are {Decision 2}.
The encapsulated decisions for this service are {Decision 1}. The service requires Input data 1, but not Input data 2 or
Input data 3.
In its simplest form a decision service would always evaluate all the decisions in the output set set and return all their
results.
For computational efficiency various improvements to this basic interpretation can be imagined, e.g.,
An optional input parameter specifying a list of “requested decisions” (a subset of the minimal output set).
Only the results of the requested decisions would be returned in the output context.
The decision requirements level of a decision model in DMN consists of a Decision Requirements Graph (DRG) depicted
in one or more Decision Requirements Diagrams (DRDs).
A DRG models a domain of decision-making, showing the most important elements involved in it and the dependencies
between them. The elements modeled are decisions, areas of business knowledge, sources of business knowledge, and
input data:
A Decision element denotes the act of determining an output from a number of inputs, using decision logic
which may reference one or more Business Knowledge Models.
A Business Knowledge Model element denotes a function encapsulating business knowledge, e.g., as business
rules, a decision table, or an analytic model.
An Input Data element denotes information used as an input by one or more Decisions.
A Knowledge Source element denotes an authority for a Business Knowledge Model or Decision.
The dependencies between these elements express three kinds of requirements: information, knowledge, and authority:
An Information Requirement denotes Input Data or Decision output being used as input to a Decision.
A Knowledge Requirement denotes the invocation of a Business Knowledge Model by the decision logic of a
Decision.
An Authority Requirement denotes the dependence of a DRG element on another DRG element that acts as a
source of guidance or knowledge.
DRDs may also contain any number of artifacts representing annotations of the diagram:
An Association is a dotted connector used to link a Text Annotation toa DRG Element.
These components are summarized in Table 1 and described in more detail in 6.2 Notation.
A DRG is a graph composed of elements connected by requirements, and is self-contained in the sense that all the
modeled requirements for any Decision in the DRG (its immediate sources of information, knowledge and authority) are
present in the same DRG. It is important to distinguish this complete definition of the DRG from a DRD presenting any
particular view of it, which may be a partial or filtered display: see 6.2.4 Partial views and hidden information.
6.2 Notation
The notation for all components of a DRD is summarized in Table 1 and described in more detail below.
The properties of a Decision are listed and described in 6.3.8 Business Context Element metamodel.
The properties of an Input Data element are listed and described in 6.3.10 Input Data metamodel.
b) They may be drawn from Input Data and Decisions to Knowledge Sources, where, in conjunction with use (a),
they represent the derivation of Business Knowledge Models from instances of Input Data and Decision results,
using analytics. The Knowledge Source typically represents the analytic model (or modeling process); the
Business Knowledge Model represents the executable logic generated from or dependent on the model. An
example of this use of a Knowledge Source is shown in Figure 15: in this case a business knowledge model is
based on an analytic model which is derived from input data and the results of a dependent decision.
However, the figures above are only examples. There are many other possible use cases for Authority Requirements (and
since Knowledge Sources and Authority Requirements have no execution semantics their interpretation is necessarily
vague), so this specification leaves the details of their application to the implementer.
An Authority Requirement is represented in a DRD as an arrow drawn with a dashed line and a filled circular head, as
shown in Table 1. The arrows are drawn from the source of authority to the element governed by it.
Information Authority
Requirement Requirement
Business
Knowledge
not allowed not allowed
Model
Knowledge Knowledge
Requirement Requirement
Knowledge
Source not allowed
Input Data
not allowed not allowed
Information Authority
Requirement Requirement
DRDs are not represented in the metamodel and may therefore not be interchanged; a set of definitions comprising a
DRG may be interchanged, and the recipient may generate any desired DRD from them which is supported by the
receiving implementation.
6.3 Metamodel
6.3.1 DMN Element metamodel
DMNElement is the abstract superclass for the decision model elements. It provides the optional attributes id,
description, and label, which are Strings which other elements will inherit. The id of a DMNElement is further
restricted to the syntax of an XML ID (http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#ID),
and SHALL be unique within the decision model.
Table 3 presents the attributes and model associations of the DMNElement element.
Attribute Description
extensionAttributes: ExtensionAttribute [ 0..*] This attribute is used to attach named extended attributes
and model associations. This association is not applicable
when the XML schema interchange is used, since the XSD
mechanism for supporting “anyAttribute” from other
namespaces already satisfies this requirement. See 6.3.16
Extensibility for additional information on extensibility.
Attribute Description
The Definitions class is the outermost containing object for all elements of a DMN decision model. It defines the
scope of visibility and the namespace for all contained elements. Elements that are contained in an instance of
Definitions have their own defined life-cycle and are not deleted with the deletion of other elements. The
interchange of DMN files will always be through one or more Definitions.
Definitions is a kind of NamedElement, from which an instance of Definitions inherits the name and
optional id, description, and label attributes, which are Strings.
An instance of Definitions has a namespace, which is a String. The namespace identifies the default target
namespace for the elements in the Definitions and follows the convention established by XML Schema.
An instance of Definitions may specify an expressionLanguage, which is a URI that identifies the default
expression language used in elements within the scope of this Definitions. This value may be overridden on each
individual LiteralExpression. The language SHALL be specified in a URI format. The default expression
language is FEEL (clause 10), indicated by the URI: “http://www.omg.org/spec/FEEL/20140401”. The simple
expression language S-FEEL (clause 9), being a subset of FEEL, is indicated by the same URI. DMN provides a URI for
expression languages that are not meant to be interpreted automatically (e.g., pseudo-code that may resemble FEEL but
is not): "http://www.omg.org/spec/DMN/uninterpreted/20140801".
Attribute Description
namespace: anyURI [1] This attribute identifies the namespace associated with this
Definitions and follows the convention established by XML
Schema.
expressionLanguage: anyURI [0..1] This attribute identifies the expression language used in
LiteralExpressions within the scope of this
Definitions. The Default is FEEL (Clause 10). This value
MAY be overridden on each individual LiteralExpression.
The language SHALL be specified in a URI format.
typeLanguage: anyURI [0..1] This attribute identifies the type language used in
LiteralExpressions within the scope of this
Definitions. The Default is FEEL (clause 10). This value
MAY be overridden on each individual ItemDefinition. The
language SHALL be specified in a URI format.
exporter: string [0..1] This attribute names the tool used to export the XML
serialization.
exporterVersion: string [ 0..1] This attribute names the version of the tool used to export the
XML serialization.
itemDefinition: ItemDefinition [*] This attribute lists the instances of ItemDefinition that are
contained in this Definitions.
collection: ElementCollection [*] This attribute lists the instances of ElementCollection that
are contained in this Definitions.
decisionService: DecisionService [*] This attribute lists the instances of DecisionService that are
contained in this Definitions.
import: Import [*] This attribute is used to import externally defined elements and
make them available for use by elements in this Definitions.
artifact: Artifact [0..*] Artifacts include text annotations and associations among DMN
elements.
The location of the imported element may be specified by associating an optional locationURI with an instance of
Import. The locationURI is a URI.
An instance of Import has a namespace, which is a URI that identifies the namespace of the imported element.
Table 6 presents the attributes and model associations of the Import element.
Attribute Description
importType: anyURI Specifies the style of import associated with this Import.
Attribute Description
drgElement: DRGElement [*] This attribute lists the instances of DRGElement that this
ElementCollection groups.
DRGElement is a specialization of NamedElement, from which it inherits the name and optional id,
description, and label attributes. The id of a DRGElement element SHALL be unique within the containing
instance of Definitions.
A Decision Requirements Diagram (DRD) is the diagrammatic representation of one or more instances of
DRGElement and their information, knowledge, and authority requirement relations. The instances of DRGElement
are represented as the vertices in the diagram; the edges represent instances of InformationRequirement,
KnowledgeRequirement, or AuthorityRequirement (see 6.3.12 Information Requirement metamodel, 6.3.13
Knowledge Requirement metamodel, and 6.3.14 Authority Requirement metamodel). The connection rules are
specified in 6.2.3 Connection rules).
DRGElement inherits all the attributes and model associations of NamedElement. It does not define additional
attributes and model associations of the DRGElement element.
Attribute Description
Attribute Description
text: string Text is an attribute that is text that the modeler wishes to
communicate to the reader of the Diagram.
textFormat: string = “text/plain” This attribute identifies the format of the text. It SHALL
follow the mime-type format. The default is “text/plain.”
Decision is a concrete specialization of DRGElement and it inherits the name and optional id, description,
and label attributes from NamedElement.
In addition, it may have a question and allowedAnswers, which are all strings. The optional description
attribute is meant to contain a brief description of the decision-making embodied in the Decision. The optional
question attribute is meant to contain a natural language question that characterizes the Decision such that the
output of the Decision is an answer to the question. The optional allowedAnswers attribute is meant to contain a
natural language description of the answers allowed for the question such as Yes/No, a list of allowed values, a range of
numeric values, etc.
In a DRD, an instance of Decision is represented by a decision diagram element.
The requirement subgraph of a Decision element is the directed graph composed of the Decision element itself,
its informationRequirements, its knowledgeRequirements, and the union of the requirement subgraphs of
each requiredDecision or requiredKnowledge element: that is, the requirement subgraph of a Decision
element is the closure of the informationRequirement, requiredInput, requiredDecision,
knowledgeRequirement, and requiredKnowledge associations starting from that Decision element.
An instance of Decision – that is, the model of a decision – is said to be well-formed if and only if all of its
informationRequirement and knowledgeRequirement elements are well-formed. That condition entails, in
particular, that the requirement subgraph of a Decision element SHALL be acyclic, that is, that a Decision element
SHALL not require itself, directly or indirectly.
Besides its logical components: information requirements, decision logic, etc. the model of a decision may also
document a business context for the decision (see 6.3.8 Business Context Element metamodel and Figure 21 below).
The business context for an instance of Decision is defined by its association with any number of
supportedObjectives, which are instances of Objective as defined in OMG BMM, any number of
impactedPerformanceIndicators, which are instances of PerformanceIndicator, any number of
decisionMaker, and any number of decisionOwner, which are instances of OrganisationalUnit.
In addition, an instance of Decision may reference any number of usingProcess, which are instances of
Process as defined in OMG BPMN 2.0, and any number of usingTask, which are instances of Task as defined in
OMG BPMN 2.0, and which are the Processes and Tasks that use the Decision element.
Decision inherits all the attributes and model associations from DRGElement. Table 10 presents the additional
attributes and model associations of the Decision class.
Attribute Description
question: string [0..1] A natural language question that characterizes the Decision
such that the output of the Decision is an answer to the
question.
allowedAnswers: string [0..1] A natural language description of the answers allowed for
the question such as Yes/No, a list of allowed values, a
range of numeric values, etc.
decisionLogic: Expression [0..1] The instance of Expression that represents the decision
logic for this Decision.
supportedObjective: BMM::Objective [*] This attribute lists the instances of BMM::Objective that
are supported by this Decision.
usingProcesses: BPMN::process [*] This attribute lists the instances of BPMN::process that
require this Decision to be made.
usingTasks: BPMN::task [*] This attribute lists the instances of BPMN::task that make
this Decision.
The abstract class BusinessContextElement, and its concrete specializations PerformanceIndicator and
OrganizationUnit are placeholders, anticipating a definition to be adopted from other OMG meta-models, such as
OMG OSM when it is further developed.
BusinessContextElement is a specialization of NamedElement, from which it inherits the name and optional
id, description, and label attributes.
Attribute Description
PerformanceIndicator inherits all the attributes and model associations from BusinessContextElement.
Table 12 presents the additional attributes and model associations of the PerformanceIndicator class.
Attribute Description
impactingDecision: Decision [*] This attribute lists the instances of Decision that impact
this PerformanceIndicator.
OrganisationalUnit inherits all the attributes and model associations from BusinessContextElement.
Table 13 presents the additional attributes and model associations of the OrganisationalUnit class.
Attribute Description
decisionMade: Decision [*] This attribute lists the instances of Decision that are
made by this OrganisationalUnit.
decisionOwned: Decision [*] This attribute lists the instances of Decision that are
owned by this OrganisationalUnit.
The business knowledge models that are associated with a decision are reusable modular expressions of all or part of
their decision logic.
The class BusinessKnowledgeModel is used to model a business knowledge model.
BusinessKnowledgeModel is a concrete specialization of DRGElement and it inherits the name and optional id,
description, and label attributes from NamedElement.
The requirement subgraph of a BusinessKnowledgeModel element is the directed graph composed of the
BusinessKnowledgeModel element itself, its knowledgeRequirement elements, and the union of the
requirement subgraphs of all the requiredKnowledge elements that are referenced by its
knowledgeRequirements.
Attribute Description
encapsulatedLogic: FunctionDefinition [0..1] The function that encapsulates the logic encapsulated by
this BusinessKnowledgeModel.
DMN 1.1 uses the class InputData to model the inputs of a decision whose values are defined outside of the decision
model.
InputData is a concrete specialization of DRGElement and it inherits the name and optional id, description,
and label attributes from NamedElement.
An instance of InputData defines an InformationItem that stores its value. This InformationItem may
include a typeRef that specifies the type of data that is this InputData represents, either an ItemDefinition,
base type in the specified expressionLanguage, or imported type.
In a DRD, an instance of InputData is represented by an input data diagram element. An InputData element does
not have a requirement subgraph, and it is always well-formed.
InputData inherits all the attributes and model associations from DRGElement. Table 15 presents the additional
attributes and model associations of the InputData class.
Attribute Description
The class KnowledgeSource is used to model authoritative knowledge sources in a decision model.
KnowledgeSource inherits all the attributes and model associations from DRGElement. Table 16 presents the
attributes and model associations of the KnowledgeSource class.
Attribute Description
locationURI: anyURI [0..1] The URI where this KnowledgeSource is located. The
locationURI SHALL be specified in a URI format.
Notice that an InformationRequirement element must reference the instance of Decision or InputData that
it associates with the requiring Decision element, not contain it: instances of Decision or InputData can only be
contained in Definitions elements.
An instance of InformationRequirement is said to be well-formed if and only if all of the following are true:
The Decision element that contains the instance of InformationRequirement is not in the requirement
subgraph of the referenced requiredDecision element, if this InformationRequirement element
references one.
Table 17 presents the attributes and model associations of the InformationRequirement element.
Attribute Description
Notice that a KnowledgeRequirement element must reference the instance of BusinessKnowledgeModel that
it associates with the requiring Decision or BusinessKnowledgeModel element, not contain it: instances of
BusinessKnowledgeModel can only be contained in Definitions elements.
An instance of KnowledgeRequirement is said to be well-formed if and only if all of the following are true:
Attribute Description
Notice that an AuthorityRequirement element must reference the instance of KnowledgeSource, Decision,
or InputData that it associates with the requiring element, not contain it: instances of KnowledgeSource,
Decision, or InputData can only be contained in Definitions elements.
Table 19 presents the attributes and model associations of the AuthorityRequirement element.
Attribute Description
A DecisionService element has one or more associated outputDecisions, which are the instances of
Decision required to be output by this DecisionService, i.e., the Decisions whose results the Decision Service
must return when called.
A DecisionService element has zero or more encapsulatedDecisions, which are the instances of
Decision required to be encapsulated by this DecisionService, i.e., the Decisions to be evaluated by the
Decision Service when it is called.
A DecisionService element has zero or more inputDecisions, which are the instances of Decision required
as input by this DecisionService, i.e., the Decisions whose results will be provided to the Decision Service when it
is called.
The encapsulatedDecisions, inputDecisions, and inputData attributes are optional. At least one of the
encapsulatedDecisions and inputDecisions attributes SHALL be specified.
DecisionService inherits all the attributes and model associations from NamedElement. Table 20 presents the
additional attributes and model associations of the DecisionService element.
Attribute Description
outputDecisions: Decision [1..*] This attribute lists the instances of Decision required to be
output by this DecisionService.
encapsulatedDecisions: Decision [0..*] If present, this attribute lists the instances of Decision to be
encapsulated in this DecisionService.
inputDecisions: Decision [0..*] If present, this attribute lists the instances of Decision
required as input by this DecisionService.
inputData: InputData [0..*] If present, this attribute lists the instances of InputData
required as input by this service.
6.3.16 Extensibility
The DMN metamodel is aimed to be extensible. This allows DMN adopters to extend the specified metamodel in a way
that allows them to be still DMN-compliant. It provides a set of extension elements, which allows DMN adopters to attach
additional attributes and elements to standard and existing DMN elements. This approach results in more interchangeable
models, because the standard elements are still intact and can still be understood by other DMN adopters. It's only the
additional attributes and elements that MAY be lost during interchange.
6.3.16.1 ExtensionElements
The ExtensionElements element is a container to aggregate elements from other metamodels inside any
DMNElement. Table 21 presents the attributes and model associations for the ExtensionElements element.
Attribute Description
extensionElement: Element [0..*] The contained Element. This association is not applicable when the
XML schema interchange is used, since the XSD mechanism for
supporting “any” elements from other namespaces already satisfies
this requirement.
6.3.16.2 ExtensionAttribute
The ExtensionAttribute element contains an Element or a reference to an Element from another metamodel. An
ExtensionAttribute also has a name to define the role or purpose of the associated element. This type is not
applicable when the XML schema interchange is used, since the XSD mechanism for supporting "anyAttribute" from
other namespaces already satisfies this requirement. Table 22 presents the model associations for the
ExtensionAttribute element.
Attribute Description
value: Element [0..1] The contained Element. This attribute SHALL NOT be used
together with valueRef.
valueRef: Element [0..1] A reference to the associated Element. This attribute SHALL NOT
be used together with value.
6.4 Examples
Examples of DRDs are provided in 11.3 The decision requirements level.
A literal expression represents decision logic as text that describes how an output value is derived from its
input values. The expression language may, but need not, be formal or executable: examples of literal
expressions include a plain English description of the logic of a decision, a first order logic proposition, a Java
computer program and a PMML document. Clause 10 specifies an executable expression language called
FEEL. Clause 9 specifies a subset of FEEL (S-FEEL) that is the default language for literal expressions in
DMN decision tables (Clause 8).
A decision table is a tabular representation of decision logic, based on a discretization of the possible values of
the inputs of a decision, and organized into rules that map discretized input values onto discrete output values
(see Clause 8).
An invocation is a tabular representation of how decision logic that is represented by a business knowledge
model is invoked by a decision, or by another business knowledge model. An invocation may also be
represented as a literal expression, but usually the tabular representation will be more understandable.
Tabular representations of decision logic are called boxed expressions in the remainder of this specification.
All three DMN conformance levels include all the above expressions. At DMN Conformance Level 1, literal expressions
are not interpreted and, therefore, free. At DMN Conformance Level 2, literal expressions are restricted to S-FEEL.
Clause 10 specifies additional boxed expressions available at DMN Conformance Level 3.
Decision logic is added to a decision model by including a value expression component in some of the decision model
elements in the DRG:
From a decision logic viewpoint, a decision is a piece of logic that defines how a given question is answered,
based on the input data. As a consequence, each decision element in a decision model may include a value
expression that describes how a decision outcome is derived from its required input, possibly invoking a
business knowledge model.
From a decision logic viewpoint, a business knowledge model is a piece of decision logic that is defined as a
function allowing it to be re-used in multiple decisions. As a consequence, each business knowledge model
element may include a value expression, which is the body of that function.
Another key component of the decision logic level is the variable: Variables are used to store values of Decisions and
InputData for use in value expressions. InformationRequirements specify variables in scope via reference to those
Decisions and InputData, so that value expressions may reference these variables. Variables link information
requirements in the DRG to the value expressions at the decision logic level.
From a decision logic viewpoint, an information requirement is a requirement for an externally provided value
to be assigned to a free variable in the decision logic, so that a decision can be evaluated. As a consequence,
each information requirement in a decision model points to a Decision or InputData, which in turn defines a
variable that represents the associated data input in the decision’s expression.
The input variables of a decision's decision logic must not be used outside that value expression or its component value
expressions: the decision element defines the lexical scope of the input variables for its decision logic. To avoid name
collisions and ambiguity, the name of a variable must be unique within its scope. When DRG elements are mapped to
FEEL, the name of a variable is the same as the (possibly qualified) name of its associated input data or decision, which
guarantees its uniqueness.
When DRG elements are mapped to FEEL, all the decisions and input data in a DRG define a context, which is the literal
expression that represents the logic associated with the decision element and that represents that scope. The information
requirement elements in a decision are context entries in the associated context, where the key is the name of the variable
that the information requirement defines, and where the expression is the context that is associated with the required
decision or input data element that the information requirement references. The value expression that is associated with
the decision as its decision logic is the expression in the context entry that specifies what is the result of the context.
In the same way, a business knowledge model element defines the lexical scope of its parameters, that is, of the input
variables for its body.
In FEEL, the literal expression and scoping construct that represents the logic associated with a business knowledge
model element is a function definition (see 10.3.2.11 Function Semantics), where the formal parameters are the names
of the parameters in the business knowledge model element, and the expression is the value expression that is the body of
the business knowledge model element.
If a business knowledge model element requires one or more other business knowledge models, it must have an explicit
value expression that describes how the required business knowledge models are invoked and their results combined or
otherwise elaborated.
At the decision logic level, a decision invokes a required business knowledge model by evaluating the business
knowledge model's value expression with the parameters bound to its own input value. How this may be achieved
depends on how the decision logic is partitioned between the decision and business knowledge models:
7.2 Notation
7.2.1 Expressions
We define a graphical notation for decision logic called boxed expressions. This notation serves to decompose the
decision logic model into small pieces that can be associated with DRG artifacts. The DRD plus the boxed expressions
form a complete, mostly graphical language that completely specifies Decision Models.
In addition to the generic notion of boxed expression, this section specifies two kinds of boxed expressions:
boxed literal expression
boxed invocation
The boxed expression for a decision table is defined in clause 8. Further types of boxed expressions are defined for
FEEL, in Clause 10.
Boxed expressions are defined recursively, i.e. boxed expressions can contain other boxed expressions. The top-level
boxed expression corresponds to the decision logic of a single DRG artifact. This boxed expression SHALL have a name
box that contains the name of the DRG artifact. The name box may be attached in a single box on top, as shown in
Figure 26:
Figure 27: Boxed expression with separated name and expression boxes
Name is the only visual link defined between DRD elements and boxed expressions. Graphical tools are expected to
support appropriate graphical links, for example, clicking on a decision shape opens a decision table. How the boxed
expression is visually associated with the DRD element is left to the implementation.
Credit
U Risk Category Contingency
Factor
1 HIGH, DECLINE 0.6
2 MEDIUM 0.7
3 LOW, VERY LOW 0.8
Credit
U Risk Category Contingency
Factor
1 “HIGH”, “DECLINE” 0.6
2 “MEDIUM” 0.7
3 “LOW”, “VERY LOW” 0.8
Name
The invoked business knowledge model is represented by the name of the business knowledge model. Any other visual
linkage is left to the implementation.
7.3 Metamodel
An important characteristic of decisions and business knowledge models is that they may contain an expression that
describes the logic by which a modeled decision shall be made, or pieces of that logic.
The class Expression is the abstract superclass for all expressions that are used to describe complete or parts of
decision logic in DMN models and that return a single value when interpreted (see 7.3.1 Expression metamodel). Here
“single value” possibly includes structured data, such as a decision table with multiple output clauses.
DMN defines three concrete kinds of Expression: LiteralExpression, DecisionTable (see clause 8), and
Invocation.
An expression may reference variables, such that the value of the expression, when interpreted, depends on the values
assigned to the referenced variables. The class InformationItem is used to model variables in expressions.
An Expression references zero or more variables implicitly by using their names in its expression text. These
variables, which are instances of InformationItem, are lexically scoped, depending on the Expression type. If
the Expression is the logic of a Decision, the scope includes that Decision's requirements. If the Expression
is the body of the encapsulatedLogic of a BusinessKnowledgeModel, the scope includes the
An instance of Expression can be interpreted to derive a single value from the values assigned to its variables. How
the value of an Expression element is derived from the values assigned to its variables depends on the concrete kind
of the Expression.
The default type language for all elements can be specified in the Definitions element using the typeLanguage
attribute. For example, a typeLanguage value of http://www.w3.org/2001/XMLSchema” indicates that the data
structures used by elements within that Definitions are in the form of XML Schema types. If unspecified, the
default is FEEL.
Notice that the data types that are built-in in the typeLanguage that is associated with an instance of Definitions
need not be redefined by ItemDefinition elements contained in that Definitions element: they are considered
imported and can be referenced in DMN elements within the Definitions element.
The type language can be overridden locally using the typeLanguage attribute in the ItemDefinition element.
Notice, also, that the data types and structures that are defined at the top level in a data model that is imported using an
Import element that is associated with an instance of Definitions need not be redefined by ItemDefinition
elements contained in that Definitions element: they are considered imported and can be referenced in DMN
elements within the Definitions element.
An ItemDefinition element SHALL have a typeRef, which is a QName that references, by namespace prefix and
local name, either an ItemDefinition in the current instance of Definitions or a built-in type in the specified
typeLanguage or a type defined in an imported DMN, XSD, or other document. In the latter case, the external
document SHALL be imported in the Definitions element that contains the instance of ItemDefinition, using
an Import element. For example, in the case of data structures contributed by an XML schema, an Import would be
used to specify the file location of that schema, and the typeRef attribute would reference the type or element
definition in the imported schema. If the type language is FEEL the built-in types are the FEEL built-in data types:
number, string, boolean, days and time duration, years and months duration, time, and date and time.
An ItemDefinition element may restrict the values that are allowed from typeRef, using the allowedValues
attribute. The allowedValues are an instance of unaryTests that specifies the allowed values or ranges of allowed
values within the domain of the typeRef. The type of the allowed values SHALL be consistent with the containing
ItemDefinition element. If an ItemDefinition element contains one or more allowedValues, the
The ItemDefinition element specializes NamedElement and it inherits its attributes and model associations.
Table 23 presents the additional attributes and model associations of the ItemDefinition element.
Attribute Description
typeRef: String [1] This attribute identifies by namespace-prefixed name the base type
of this ItemDefinition.
typeLanguage: String [0..1] This attribute identifies the type language used to specify the base
type of this ItemDefinition. This value overrides the type
language specified in the Definitions element. The language
SHALL be specified in a URI format.
allowedValues: UnaryTests [0..1] This attribute lists the possible values or ranges of values in the base
type that are allowed in this ItemDefinition.
itemComponent: ItemDefinition[*] This attribute defines zero or more nested ItemDefinitions that
compose this ItemDefinition.
IsCollection: Boolean Setting this flag to true indicates that the actual values defined by
this ItemDefinition are collections of allowed values. The
default is false.
InformationItem is a concrete subclass of NamedElement, from which it inherits the id, and optional name,
description, and label attributes, except that an InformationItem element SHALL have a name attribute,
which is the name that is used to represent it in other Expression elements. The name of an InformationItem
element SHALL be unique within its scope.
An InformationItem element contained in a Decision is assigned the value of the Decision's value
expression.
An InformationItem element that is a parameter in a FunctionDefinition is assigned a value by a
Binding element as part of an instance of Invocation.
An InformationItem element contained in an InputData is assigned a value by an external data source
that is attached at runtime.
An InformationItem element contained in a ContextEntry is assigned a value by the
ContextEntry's value expression.
In any case, the datatype indicated by the typeRef that is associated with an instance of InformationItem SHALL
be compatible with the datatype that is associated with the DMN model element from which it takes its value.
InformationItem inherits all of the attributes and model associations of NamedElement. Table 24 presents the
additional attributes and model associations of the InformationItem element.
Attribute Description
LiteralExpression inherits all of the attributes and model associations of Expression. Table 25 presents the
additional attributes and model associations of the LiteralExpression element.
Attribute Description
expressionLanguage: anyURI [0..1] This attribute identifies the expression language used in this
LiteralExpression. This value overrides the expression
language specified for the containing instance of
DecisionRequirementDiagram. The language SHALL
be specified in a URI format.
importedValues: ImportedValues [0..1] The instance of ImportedValues that specifies where the
text of this LiteralExpression is located.
An instance of Invocation is made of zero or more binding, which are instances of Binding, and model how the
bindingFormulas are bound to the formalParameters of the invoked function. The formalParameters of a
FunctionDefinition are InformationItems and the parameters of the Bindings are InformationItems.
The binding is by matching the InformationItem names.
The value of an instance of Invocation is the value of the associated calledFunction's body, with its
formalParameters assigned values at runtime per the bindings in the Invocation.
The calledFunction that is associated with the Invocation element SHALL BE the encapsultedLogic of
the BusinessKnowledgeModel element that is required by the Decision element that contains the
Invocation. The Invocation element SHALL have exactly one binding for each parameter in the
BusinessKnowledgeModel's encapsulatedLogic.
Invocation inherits all of the attributes and model associations of Expression. Table 26 presents the additional
attributes and model associations of the Invocation element.
Attribute Description
binding: Binding [*] This attribute lists the instances of Binding used to bind the
formalParameters of the calledFunction in this
Invocation.
A Binding is made of one bindingFormula, which is an Expression, and of one parameter, which is an
InformationItem.
The parameter names in the Binding elements SHALL be a subset of the formalParameters of the
calledFunction.
When the Invocation element is executed, each InformationItem element that is referenced as a parameter
by a binding in the Invocation element is assigned, at runtime, the value of the bindingFormula.
Table 27 presents the attributes and model associations of the Binding element.
Attribute Description
bindingFormula: Expression [0..1] The instance of Expression to which the parameter in this
Binding is bound when the owning instance of Invocation is
evaluated.
An information item name: the name of an InformationItem, if any, for which the decision table is its value
expression. This will usually be the name of the Decision or Business Knowledge Model for which the decision
table provides the decision logic.
An output label, which can be any text to describe the output of the decision table. The result of a decision table
must be referenced using the information item name, not the output label, in another expression.
A set of inputs (zero or more). Each input is made of an input expression and a number of input entries.The
specification of input expression and all input entries is referred to as the input clause.
A set of outputs (one or more). A single output has no name, only a value. Two or more outputs are called
output components. Each output component SHALL be named. Each output (component) SHALL specify an
output entry for each rule. The specification of output component name (if multiple outputs) and all output
entries is referred to as an output clause.
A list of rules (one or more) in rows or columns of the table (depending on orientation), where each rule is
composed of the specific input entries and output entries of the table row (or column). If the rules are expressed
as rows, the columns are clauses, and vice versa.
Figure 35: Decision table example (horizontal orientation: multiple output components)
reads as:
If Customer = “Business” and OrderSize < 10 then Discount = 0.10
The three highlighted cells in the decision table fragment above represent the following rule:
If the value of input expression 1 satisfies input entry a
and the value of input expression 2 satisfies input entry b
then the rule matches and the result of the decision table is output entry c.
An input expression value satisfies an input entry if the value is equal to the input entry, or belongs to the list of values
indicated by the input entry (e.g., a list or a range). If the input entry is ‘-’ (meaning irrelevant), every value of the input
expression satisfies the input entry and that particular input is irrelevant in the specified rule.
A rule matches if the value of every input expression satisfies the corresponding input entry. If there are no input entries,
any rule matches.
The list of rules expresses the logic of the decision. For a given set of input values, the matching rule (or rules) indicate
the resulting value for the output name. If rules overlap, multiple rules can match and a hit policy indicates how to
handle the multiple matches.
If two input entries of the same input expression share no values, the entries (cells) are called disjoint. If there is an
intersection, the entries are called overlapping (or even equal). ‘Irrelevant’ (‘-’) overlaps with any input entry of the input
expression.
Two rules are overlapping if all corresponding input entries are overlapping. A specific configuration of input data may
then match the two rules.
Two rules are disjoint (non-overlapping) if at least one pair of corresponding input expressions is disjoint. No specific
configuration of input data will match the two rules.
If tables are allowed to contain overlapping rules, the table hit policy indicates how overlapping rules have to be handled
and which is the resulting value(s) for the output name, in order to avoid inconsistency.
8.2 Notation
This sub clause builds on the generic notation for decision logic and boxed expressions defined in clause 7.2 Notation.
Placement of inputs, outputs and (optional) allowed values in standard locations on a grid of cells. Each input
expression is optionally associated with unary tests restricting the allowed input values. In this text the optional
cells with allowed values are indicated in inverse. Each output (component) is optionally associated with
allowed values. In this text the optional allowed output values are indicated in inverse.
Line style and optional use of color.
The contents of specific rule input and output entry cells.
The hit policy, indicating how to interpret overlapping input combinations.
Placement of information item name, hit policy (H) and rule numbers as indicated in Figure 36, Figure 38, and
Figure 40. Rule numbers are consecutive natural numbers starting at 1. Rule numbering is required for tables
with hit indicator F (first) or R (rule order), because the meaning depends on rule sequence. Crosstab tables
have no rule numbers. Rule numbering is optional for other table types.
Input expressions, input values, output values, input entries, and output entries can be any text (e.g., natural language,
formal language, pseudo-code). Implementations claiming level 2 or 3 conformance SHALL support (S-)FEEL syntax.
Implementations claiming level 1 conformance are not required to interpret the expressions. To avoid misinterpretation
(e.g., when expressions are not meant to be valid (S-)FEEL but may conflict with the look and feel of (S-)FEEL syntax),
conformant implementations SHOULD indicate when the input expression is not meant to be interpreted by using the
URI: "http://www.omg.org/spec/DMN/uninterpreted/20140801".
8.2.1 Line style and color
Line style is normative. There is a double line between the inputs section and the outputs section, and there is a double
line between input/output expressions and the rule entry cells. Other cells are separated by a single line.
Color is suggested, but does not influence the meaning. It is considered good practice to use different colors for the input
expressions section and the output name section, and another (or no) color for the rule entries.
Discount
U Customer OrderSize Delivery Discount
Business, Private,
Government <10, >=10 sameday, slow 0, 0.05, 0.10, 0.15
1 <10 - 0.05
Business
2 >=10 - 0.10
3 sameday 0
Private -
4 slow 0.05
5 Government - - 0.15
Figure 40: Rules as crosstab – schematic layout (optional input and output values not shown)
Discount
Customer
Discount
Business Private Government
Figure 41: Rules as crosstab – simplified example with only two inputs
Crosstab tables with more than two inputs are possible (as shown in Figure 42).
8.2.5 Information Item names, output labels, and output component names
A decision table with multiple output components SHALL specify a name for each output component.
A decision table that is the value expression of an InformationItem (e.g., a Decision's logic or a boxed Invocation's
binding formula) SHALL specify the name of the InformationItem as its Information Item name. A decision table that is
not contained in another boxed expression shall place the Information Item name in a name box just above and adjoining
the table.
A decision table that is contained in another boxed expression may use the containing expression for its Information Item
name. For example, the Information Item name for a decision table bound to a function parameter is the name of the
function parameter. Or, to save space, the Information Item name box may be omitted and the Output label used instead.
Decision tables with compound outputs support only the following hit policies: Unique, Any, Priority, First, Output
order, Rule order and Collect without operator, because the collect operator is undefined over multiple outputs.
For the Priority and Output order hit policies, priority is decided in compound output tables over all the outputs for
which output values have been provided. The priority for each output is specified in the ordered list of output values in
decreasing order of priority, and the overall priority is established by considering the ordered outputs from left to right in
horizontal tables (i.e., columns to the left take precedence over columns to the right), or from top to bottom in vertical
tables. Outputs for which no output values are provided are not taken into account in the ordering, although their output
entries are included in the ordered compound output.
So, for example, if called with Age = 17, Risk category = “HIGH” and Debt review = true, the Routing rules table in
Figure 50 would return the outputs of all four rules, in the order 2, 4, 3, 1.
Routing rules
O Age Risk Debt Routing Review Reason
category review level
LOW, DECLINE, LEVEL 2,
MEDIUM, REFER, LEVEL 1,
HIGH ACCEPT NONE
1 - - - ACCEPT NONE Acceptable
2 < 18 - - DECLINE NONE Applicant too young
3 - HIGH - REFER LEVEL 1 High risk application
4 - - true REFER LEVEL 2 Applicant under debt review
Note 1
Crosstab tables are unique and complete by definition and therefore do not need a hit policy.
Note 2
The sequence of the rules in a decision table does not influence the meaning, except in First tables (single hit) and
Rule order tables (multiple hit). These tables should be used with care.
8.3 Metamodel
An instance of DecisionTable contains a set of rules, which are instances of DecisionRule, a set of inputs,
An instance of DecisionTable has an associated hitPolicy, which SHALL be one of the enumerated
HitPolicy: UNIQUE, FIRST, PRIORITY, ANY, COLLECT, RULE ORDER, OUTPUT ORDER. The default value
for the hitPolicy attribute is: UNIQUE. In the diagrammatic representation of an instance of DecisionTable, the
hitPolicy is represented as specified in 8.2.11 Hit policy.
The semantics that is associated with an instance of DecisionTable depends on its associated hitPolicy, as
specified below and in 8.2.11 Hit policy. The hitPolicy attribute of an instance of DecisionTable is represented
as specified in 8.2.11 Hit policy.
If the hitPolicy associated with an instance of DecisionTable is FIRST or RULE ORDER, the rules that are
associated with the DecisionTable SHALL be ordered. The ordering is represented by the explicit numbering of
the rules in the diagrammatic representation of the DecisionTable.
If the hitPolicy associated with an instance of DecisionTable is PRIORITY or OUTPUT ORDER, the
outputValues determine the result as specified in 8.2.11 Hit policy.
If the hitPolicy that is associated with an instance of DecisionTable is COLLECT, the DecisionTable MAY
have an associated aggregation, which is one of the enumerated BuiltinAggregator (see 8.2.11 Hit policy).
As a kind of Expression, an instance of DecisionTable has a value, which depends on the outputs of the
associated rules, the associated hitPolicy and the associated aggregration, if any. The value of an instance of
DecisionTable is determined according to the following specification:
if the associated hitPolicy is UNIQUE, the value of an instance of DecisionTable is the value of the
conclusion of the only applicable rule (see 8.3.3 Decision Rule metamodel for the definition of rule
applicability);
if the associated hitPolicy is FIRST, the value of an instance of DecisionTable is the value of the
conclusion of the first applicable rule, according to the rule ordering;
if the associated hitPolicy is PRIORITY, the value of an instance of DecisionTable is the value of the
conclusion of the of the first applicable rule, according to the ordering of the outputEntry in the list
of output values;
if the associated hitPolicy is ANY, the value of an instance of DecisionTable is the value of any of the
applicable rules;
if the associated hitPolicy is COLLECT and an aggregation is specified, the value of an instance of
DecisionTable is the result of applying the aggregation function specified by the aggregation attribute
of the DecisionTable to the unordered set of the values of the conclusions of all the applicable rules;
if the aggregation attribute is not specified, the value of the decision table is the unordered set itself;
if the associated hitPolicy is RULE ORDER, the value of an instance of DecisionTable is the list of the
values of the conclusions of all the applicable rules, ordered according to the rule ordering;
if the associated hitPolicy is OUTPUT ORDER, the value of an instance of DecisionTable is the list of
the values of the conclusions of all the applicable rules, ordered according to the ordering of the
outputEntry in the conclusion.
DecisionTable inherits all the attributes and model associations from Expression. Table 28 presents the
additional attributes and model associations of the DecisionTable element.
Attribute Description
input: InputClause [*] This attribute lists the instances of InputClause that compose this
DecisionTable.
output: OutputClause [*] This attribute lists the instances of OutputClause that compose
this DecisionTable.
rule: DecisionRule [*] This attribute lists the instances of DecisionRule that compose
this DecisionTable.
hitPolicy: HitPolicy The hit policy that determines the semantics of this
DecisionTable. Default is: UNIQUE.
outputLabel: string[0..1] This attribute gives a description of the decision table output, and is
often the same as the name of the InformationItem for which the
decision table is the value expression.
The class InputClause is used to model a decision table input, and the class OutputClause is used to model a
decision table output.
An instance of InputClause is made of an optional inputExpression and an ordered list of inputEntry,
which are instances of UnaryTests. An instance of OutputClause optionally references a typeRef, specifying
its datatype, and it is made of an ordered list of outputEntry, which are instances of LiteralExpression, and
an optional defaultOutputEntry, which is also an instance of LiteralExpression.
When a DecisionTable contains more than one OutputClause, each OutputClause SHALL have a name.
When a DecisionTable has a single OutputClause, the OutputClause SHALL NOT have a name.
Tables 29a and 29b present the attributes and model associations of InputClause and OutputClause.
Attribute Description
Attribute Description
typeRef: QName [0..1] The OutputClause of a single output decision table SHALL
NOT specify a typeRef. OutputClauses of a multiple
output decision table MAY specify a typeRef. A typeRef is
the name of the datatype of the output, either an
ItemDefinition, a base type in the specified
expressionLanguage, or an imported type.
name: string [0.1] The OutputClause of a single output decision table SHALL
NOT specify a name. OutputClauses of a multiple output
decision table SHALL specify a name.
outputEntry: Expression [*] This attribute lists the instances of Expression that compose
this OutputClause.
An instance of DecisionRule has an ordered list of inputEntry instances which are instances of UnaryTests,
and an ordered list of outputEntry instances, which are instances of LiteralExpression.
By definition, a DecisionRule element that has no inputEntrys is always applicable. Otherwise, an instance of
DecisionRule is said to be applicable if and only if, at least one of the rule's inputEntrys match their
corresponding inputExpression value. The inputEntrys are matched in arbitrary order.
The inputEntry elements SHALL be in the same order as the containing DecisionTable's inputs.
The ith inputExpression must satisfy the ith inputEntry for all inputEntrys in order for the
DecisionRule to match, as defined in 8.1 Introduction.
The outputEntry elements SHALL be in the same order as the containing DecisionTable's outputs.
The ith outputEntry SHALL be consistent with the typeRef of the ith OutputClause.
Attribute Description
inputEntry: UnaryTests[0..*] The instances of UnaryTests that specify the input conditions
that this DecisionRule must match for the corresponding (by
index) inputExpression.
8.4 Examples
Table 31 provides examples for the various types of decision table discussed in this sub clause. Further examples may be
found in 11.3 The decision requirements level, in the context of a complete example of a DMN decision model.
Single Hit
Any Person Loan Compliance
A Persons Credit Rating Person Credit Card Person Education Loan Person Loan
from Bureau Balance Balance Compliance
1 A < 10000 < 50000 Compliant
2 Not(A) - - Not Compliant
3 - >= 10000 - Not Compliant
4 - - >= 50000 Not Compliant
Example case: not A, >= $10K, >= 50K -> Not Compliant (rules 2,3,4)
Single Hit
First Special Discount
F Type of Order Customer Location Type of Customer Special Discount %
1 Web US Wholesaler 10
2 Phone - - 0
3 - Non-US - 0
4 - - Retailer 5
Special Discount
Type of Order Web -
Customer Location US -
Type of Customer Wholesaler Retailer -
Special Discount % 10 5 0
F 1 2 3
Multiple Hit
No order Holidays
Multiple Hit
Rule order Student Financial Package Eligibility
R Student Student Extra- Student National Student Financial Package
GPA Curricular Honor Society Eligibility List
Activities Count Membership
1 > 3.5 >= 4 Yes 20% Scholarship
2 > 3.0 - Yes 30% Loan
3 > 3.0 >= 2 No 20% Work-On-Campus
4 <= 3.0 - - 5% Work-On-Campus
Example case: For GPA=3.6, EC Activities=4, NHS Membership -> result = (20% scholarship, 30%
loan)
op:add-yearMonthDurations and op:subtract-yearMonthDurations, when the two operands are years and months
durations;
is in the interval (e1..e2), also notated ]e1..e2[, if and only if o > e1 and o < e1
is in the interval (e1..e2], also notated ]e1..e2], if and only if o > e1 and o ≤ e2
An expression to be tested satisfies an instance of simple unary tests (grammar rule 14) if and only if, either the
expression is a list and the expression satisfies at least one simple unitary test in the list, or the simple unitary tests is “-”.
9.5.2 Invocations
In the bindings of an invocation, the binding formula SHALL be a simple expression (grammar rule 5).
Side-effect free
Simple data model with numbers, dates, strings, lists, and contexts
This section also completely specifies the syntax and semantics of FEEL. The syntax is specified as a grammar (10.3.1
Syntax). The subset of the syntax intended to be rendered graphically as a boxed expression is also specified as a meta-
model (10.5 Metamodel).
FEEL has two roles in DMN:
1. As a textual notation in the boxes of boxed expressions such as decision tables,
2. As a slightly larger language to represent the logic of expressions and DRGs for the main purpose of
composing the semantics in a simple and uniform way.
10.2 Notation
10.2.1 Boxed Expressions
This section builds on the generic notation for decision logic and boxed expressions defined in 7.2 Notation.
We define a graphical notation for decision logic called boxed expressions. This notation serves to decompose the
decision logic model into small pieces that can be associated with DRG artifacts. The DRG plus the boxed expressions
form a complete, mostly graphical language that completely specifies Decision Models.
A boxed expression is either:
a decision table
a boxed invocation
a boxed context
a boxed list
a relation, or
a boxed function
Boxed expressions are defined recursively, i.e., boxed expressions can contain other boxed expressions. The top-level
boxed expression corresponds to the decision logic of a single DRG artifact. This boxed expression SHALL have a name
box that contains the name of the DRG artifact. The name box may be attached in a single box on top, as shown in
Figure 52:
Name
top-level boxed expression
Alternatively, the name box and expression box can be separated by white space and connected on the left side with a
line, as shown in Figure 53:
Name
Figure 53: Boxed expression with separated name and expression boxes
Graphical tools are expected to support appropriate graphical links, for example, clicking on a decision shape opens a
decision table.
The meaning of a boxed expression containing e is FEEL(e, s), where s is the scope. The scope includes the context
derived from the containing DRD as described in 10.4 Execution Semantics of Decision Services , and any boxed
contexts containing e.
It is usually good practice to make e relatively simple, and compose small boxed expressions into larger boxed
expressions.
The box labeled 'invoked business knowledge model' can be any boxed expression whose value is a function, as shown
in Figure 55:
Name
function-valued expression
The boxed syntax maps to the textual syntax defined by grammar rules 40, 41, 42, 43. Boxed invocation uses named
parameters. Positional invocation can be achieved using a boxed expression containing a textual positional invocation.
The boxed syntax requires at least one parameter. A parameterless function must be invoked using the textual syntax,
e.g., as shown in Figure 56.
function-valued expression()
Formally, the meaning of a boxed invocation is given by the semantics of the equivalent textual invocation, e.g.,
function-valued expression(parameter1: binding expression1, parameter2: binding expression2, …).
Name 1 Value 1
Name 2 Value 2
Name n Value n
Result
Applicant Data
Age 51
MaritalStatus "M"
EmploymentStatus "EMPLOYED"
ExistingCustomer false
Repayments 2500.00
Expenses 3000.00
Contexts with a final result box are useful for representing calculations (see Figure 60).
Eligibility
When decision tables are (non-result) context entries, the output cell can be used to name the entry, thus saving space.
Any format decision table can be used in a vertical context. A jagged right edge is allowed. Whitespace between context
entries may be helpful. See Figure 61.
Name 1 Value 1
Name 2
Name n Value n
Result
Color is suggested.
The names SHALL be legal FEEL names. The values and optional result are boxed expressions.
Boxed contexts may have a decision table as the result, and use the named context entries to compute the inputs, and
give them names. For example (see Figure 62):
1 <590 “HIGH”
3 >610 “LOW”
true
4 <600 “HIGH”
6 >625 “LOW”
7 <580 “HIGH”
9 >600 “LOW”
false
10 <590 “HIGH”
12 >615 “LOW”
Formally, the meaning of a boxed context is { “Name 1”: Value 1, “Name 2”: Value 2, …, “Name n”: Value n } if no
Result is specified. Otherwise, the meaning is { “Name 1”: Value 1, “Name 2”: Value 2, …, “Name n”: Value n,
“result”: Result }.result. Recall that the bold face indicates elements in the FEEL Semantic Domain. The scope includes
the context derived from the containing DRG as described in 10.4 Execution Semantics of Decision Services .
Item 1
Item 2
Item n
Line styles are normative. The items are boxed expressions. Formally, the meaning of a boxed list is just the meaning of
the list, i.e., [ Item 1, Item 2, …, Item n ]. The scope includes the context derived from the containing DRG as
described in 10.4 Execution Semantics of Decision Services .
10.2.1.6 Relation
A vertical list of homogeneous horizontal contexts (with no result cells) can be displayed with the names appearing just
once at the top of the list, like a relational table, as shown in Figure 65:
K (Parameter1, Parameter2, …)
Body
For FEEL functions, denoted by Kind FEEL or by omission of Kind, the Body SHALL be a FEEL expression that
references the parameters. For externally defined functions denoted by Kind Java, the Body SHALL be a context as
described in 10.3.2.11.2 Externally-defined functions and the form of the mapping information SHALL be the java form.
For externally defined functions denoted by Kind PMML, the Body SHALL be a context as described in 10.3.2.11.2 and
the form of the mapping information SHALL be the pmml form.
Formally, the meaning of a boxed function is just the meaning of the function, i.e., FEEL(function(Parameter1,
Parameter2, …) Body) if the Kind is FEEL, and FEEL(function(Parameter1, Parameter2, …) external Body) otherwise.
The scope includes the context derived from the containing DRG as described in 10.4 Execution Semantics of Decision
Services .
10.2.2 FEEL
A subset of FEEL, defined in the next section, serves as the notation "in the boxes" of boxed expressions. A FEEL object
is a number, a string, a date, a time, a duration, a function, a context, or a list of FEEL objects (including nested lists).
Note: A JSON object is a number, a string, a context (JSON calls them maps) or a list of JSON objects. So FEEL is an
extension of JSON in this regard. In addition, FEEL provides friendlier syntax for literal values, and does not require
context keys to be quoted.
Here we give a "feel" for the language by starting with some simple examples.
5 in ( <=5 ) true
5 in ( (5..10] ) false
5 in ( [5..10] ) true
2012-12-31 in true
( (2012-12-25..2013-02-14) )
10.2.2.2 Numbers
FEEL numbers and calculations are exemplified in Table 33.
decimal(1, 2) 1.00
.25 + .2 0.45
1/3 0.3333333333333333333333333333333333
decimal(1/3, 2) 0.33
1 = 1.000 true
1.01/2 0.505
decimal(0.505, 2) 0.50
decimal(0.515, 2) 0.52
1.0*10**3 1000.0
10.3.1 Syntax
FEEL syntax is defined as grammar here and equivalently as a UML Class diagram in the meta-model (10.5 Metamodel).
Example Meaning
S1 | S2 Either S1 or S2
S1, S2 S1 followed by S2
k * S1 S1 repeated k times
We extend the ISO notation with character ranges for brevity, as follows:
A character range has the following EBNF syntax:
number
string
boolean
days and time duration
years and months duration
time
date and time
Duration and date/time datatypes have no literal syntax. They must be constructed from a string representation using a
built-in function (10.3.4.1 Conversion functions.
Nested lists encountered in the interpretation of N1.N2 … Nn are preserved. For example,
[{a: [{b: 1}, {b: [2.1, 2.2]}]}, {a: [{b: 3}, {b: 4}, {b: 5}]}].a.b =
[[{b: 1}, {b: [2.1, 2.2]}], [{b: 3}, {b: 4}, {b: 5}]].b =
[[1, [2.1, 2.1]],[ 3, 4, 5]]
Nested lists can be flattened using the flatten() built-in function (10.3.4 Built-in functions).
10.3.1.5 Ambiguity
Names of context entries and function parameters can contain commonly used characters such as space and apostrophe
(but cannot contain a colon or comma (':' or ',')). This naming freedom makes FEEL’s syntax ambiguous. Ambiguity is
resolved using the scope. Names are matched from left to right against the names in-scope, and the longest match is
preferred. In the case where the longest match is not desired, parenthesis or other punctuation (that is not allowed in a
name) can be used to disambiguate a FEEL expression. For example, to subtract b from a if ‘a-b’ is the name of an in-
scope context entry, one could write
(a)-(b)
10.3.2 Semantics
FEEL semantics is specified by mapping syntax fragments to values in the FEEL semantic domain. Literals (clause
10.3.1.3 Literals, data types, built-in functions) can be mapped directly. Expressions composed of literals are mapped to
values in the semantic domain using simple logical and arithmetic operations on the mapped literal values. In general,
the semantics of any FEEL expression are composed from the semantics of its sub-expressions.
A function is a lambda expression with lexical closure or is externally defined by Java or PMML. A list is an ordered
collection of domain elements, and a context is a partially ordered collection of (string, value) pairs called context
entries.
We use italics to denote syntactic elements and boldface to denote semantic elements. For example,
FEEL([1+1, 2+2]) is [2, 4]
Note that we use bold [] to denote a list in the FEEL semantic domain, and bold numbers 2, 4 to denote those decimal
values in the FEEL semantic domain.
10.3.2.3.1 number
FEEL Numbers are based on IEEE 754-2008 Decimal128 format, with 34 decimal digits of precision and rounding
toward the nearest neighbor with ties favoring the even neighbor. Numbers are a restriction of the XML Schema type
precisionDecimal, and are equivalent to Java BigDecimal with MathContext DECIMAL128.
Grammar rule 37 defines literal numbers. Literals consist of base 10 digits and an optional decimal point. –INF, +INF,
and NaN literals are not supported. There is no distinction between
-0 and 0. The number(from, grouping separator, decimal separator) built-in function supports a richer literal format. For
example, FEEL(number("1.000.000,01", ".", ",")) = 1000000.01.
FEEL does not support a literal scientific notation. For example, 1.2e3 is not valid FEEL syntax. Use 1.2*10**3 instead.
A FEEL number is represented in the semantic domain as a pair of integers (p,s) such that p is a signed 34 digit integer
carrying the precision information, and s is the scale, in the range [−6111..6176]. Each such pair represents the number
p/10s. To indicate the numeric value, we write value(p,s). For example, value(100,2) = 1. If precision is not of concern,
we may write the value as simply 1. Note that many different pairs have the same value. For example, value(1,0) =
value(10,1) = value(100,2).
There is no value for notANumber, positiveInfinity, or negativeInfinity. Use null instead.
10.3.2.3.2 string
Grammar rule 35 defines literal strings as a double-quoted sequence of characters, e.g., "abc".
The literal string "abc" is mapped to the semantic domain as a sequence of three Unicode characters a, b, and c, written
"abc".
10.3.2.3.3 boolean
The Boolean literals are given by grammar rule 36. The values in the semantic domain are true and false.
10.3.2.3.4 time
FEEL does not have time literals, although we use boldface time literals to represent values in the semantic domain.
Times can be expressed using a string literal and the time() built-in function. (See 10.3.4.1 Conversion functions.)
A time in the semantic domain is a value of the XML Schema time datatype. It can be represented by a sequence of
numbers for the hour, minute, second, and an optional time offset from Universal Coordinated Time (UTC). If a time
offset is specified, including time offset = 00:00, the time value has a UTC form and is comparable to all time values that
The valuet function is one-to-one, but its range is restricted to [0..86400]. So, it has an inverse function valuet -1(x) that
returns: the corresponding time value for x, if x is in [0..86400]; and valuet -1(y), where y = x – floor(x/86400) * 86400,
if x is not in [0..86400].
Note: That is, valuet -1(x) is always actually applied to x modulo 86400. For example, valuet -1(3600) will return the
time of day that is “T01:00:00”, valuet -1(90000) will also return “T01:00:00”, and valuet-1(-3600) will return the time
of day that is “T23:00:00”, treating -3600 seconds as one hour before midnight.
10.3.2.3.5 date
FEEL does not have date literals, although it uses boldface date literals to represent values in the semantic domain. Dates
can be expressed using a string literal and the date() built-in function (see10.3.4.1 Conversion functions). A date in the
semantic domain is a sequence of numbers for the year, month, day of month. The year must be in the range [-
999,999,999..999,999,999].
Where necessary, including the valuedt function (see 10.3.2.x.6), a date value is considered to be equivalent to a date
time value in which the time of day is UTC midnight (00:00:00).
10.3.2.3.6 date-time
FEEL does not have date-time literals, although it uses boldface date-time literals to represent values in the semantic
domain. Date-times can be expressed using a string literal and the date and time() built-in function (see 10.3.4.1).
A date and time in the semantic domain is a sequence of numbers for the year, month, day, hour, minute, second, and
optional time offset from Universal Coordinated Time (UTC). The year must be in the range [-
999,999,999..999,999,999]. If there is an associated time offset, including 00:00, the date-time value has a UTC form
and is comparable to all other date-time values that have UTC forms. If there is no associated time offset, the time is
taken to be a local time of day at some location, according to the time zone rules for that location. When the time zone is
specified, e.g., using the IANA tz form (see 10.3.4.1 Conversion functions), the date-time value may be converted to a
UTC form using the time zone rules for that location, if applicable.
Note: projecting timezone rules into the future may only be safe for near-term date-time values.
A date and time d that has a UTC form can be represented as a number of seconds since a reference date and time (called
the epoch). We write valuedt(d) to represent the number of seconds between d and the epoch. The valuedt function is
one-to-one and so it has an inverse function valuedt-1. For example, valuedt-1(valuedt(d)) = d. valuedt-1 returns null
rather than a date with a year outside the legal range.
FEEL does not have duration literals although we use boldface duration literals to represent values in the semantic
domain.. Durations can be expressed using a string literal and the duration() built-in function. The literal format of the
characters within the quotes of the string literal is defined by the lexical space of the Xpath Data Model
dayTimeDuration datatype. A days and time duration in the semantic domain is a sequence of numbers for the days,
hours, minutes, and seconds of duration, normalized such that the sum of these numbers is minimized. For example,
FEEL(duration("P0DT25H")) = P1DT1H.
The value of a days and time duration can be expressed as a number of seconds. For example,
FEEL does not have duration literals, although we use boldface duration literals to represent values in the semantic
domain. Durations can be expressed using a string literal and the duration() built-in function. The literal format of the
characters within the quotes of the string literal is defined by the lexical space of the Xpath Data Model
yearMonthDuration datatype. A years and months duration in the semantic domain is a pair of numbers for the years and
months of duration, normalized such that the sum of these numbers is minimized. For example,
FEEL(duration("P0Y13M")) = P1Y1M.
The value of a years and months duration can be expressed as a number of months. For example,
valueymd(P1Y1M) = 13. The valueymd function is one-to-one and so it has an inverse function valueymd-1. For
example, valueymd-1(13) = P1Y1M.
For convenience, a selection using the "." operator with a list of contexts on its left hand side returns a list of selections,
i.e., FEEL(e.f, c) = [ FEEL(f, c'), FEEL(f, c''), … ] where FEEL(e) = [ e', e'', … ] and c' is c augmented with the context
entries of e', c'' is c augmented with the context entries of e'', etc. For example,
[ {x:1, y:2}, {x:2, y:3} ].y = [2,3]
10.3.2.6 Context
A FEEL context is a partially ordered collection of (key, expression) pairs called context entries. In the syntax, keys can
be either names or strings. Keys are mapped to strings in the semantic domain. These strings are distinct within a
context. A context in the domain is denoted using bold FEEL syntax with string keys, e.g., { "key1" : expr1, "key2" :
expr2, … }.
If key1 is not a legal name or for whatever reason one wishes to treat the key as a string, the following syntax is allowed:
get value(m, "key1"). Selecting a value by key from context m in the semantic domain is denoted as m.key1 or get
value(m, "key1")
To retrieve a list of key,value pairs from a context m, the following built-in function may be used: get entries(m).
For example, the following is true:
get entries({key1: "value1"})[key="key1"].value = "value1"
An expression in a context entry may not reference the key of the same context entry, but may reference keys (as QNs)
from other context entries in the same context. These references SHALL be acyclic and form a partial order. The
expressions in a context SHALL be evaluated consistent with this partial order.
10.3.2.7 Ranges
FEEL supports a compact syntax for a range of values, useful in decision table test cells and elsewhere. A range maps to
the semantic domain as a single comparable value (number, date/time/duration, or string) or a pair of comparable
endpoint values and an endpoint inclusivity code that indicates whether one or both endpoints are included in the range.
The range syntax supports literal and symbolic endpoints, but not arbitrary expressions. Because date/time/duration
values have no literal syntax, symbolic endpoints must be used for ranges of these types. For example, the following
context defines a range of duration named soon from one to two minutes, inclusive.
{
one min: duration("PT1M"),
two min: duration("PT2M"),
soon: [one min..two min]
}
decision table(
outputs: "Applicant Risk Rating",
input expression list: [Applicant Age, Medical History],
rule list: [
['>60', "good"', '"Medium"'],
['>60', '"bad"', '"High"'],
['[25..60]', '-', '"Medium"'],
['<25', '"good"', '"Low"'],
['<25', '"bad"', '"Medium"']],
The decision table built-in in 10.3.4.6 Decision Table will compose the unary tests syntax into expressions that can be
mapped to the FEEL semantic domain.
If e denotes the value of a context entry of context m, then m is the local context for e, and m is the first element of s.
Otherwise, e has no local context and the first element of s is the global context, or in some cases explained later, the first
element of s is a special context.
All of the entries of m are in-scope for e, but the depends on graph SHALL be acyclic. This provides a simple solution to
the problem of the confusing definition above: if m is the result of evaluating the context expression m that contains e,
how can we know it in order to evaluate e? Simply evaluate the context entries in depends on order.
The global context is a context provided for convenience and 'pre-compilation'. Any number of expressions can be
named and represented in a FEEL context m. The syntactic description m of this context can be evaluated once, that is,
mapped to the FEEL domain as m, and then re-used to evaluate many expressions.
Some FEEL expressions are interpreted in a special context that is pushed on the front of s. For example, a filter
expression is repeatedly executed with special first context containing the name 'item' bound to successive list elements.
A function is executed with a special first context containing argument name->value mappings.
Qualified names (QNs) in FEEL expressions are interpreted relative to s. The meaning of a FEEL expression e in scope s
is denoted as FEEL(e, s). We can also say that e evaluates to e in scope s, or e = FEEL(e, s). Note that e and s are
elements of the FEEL domain. s is a list of contexts.
date and time, javax.xml.datatype. date, dateTime, time, date, dateTime, time
time XMLGregorianCalendar dateTimestamp conversion required for
dateDaysSince, et. al.
function X X X
Sometimes we do not want to evaluate a FEEL expression e, we just want to know the type of e. Note that if e has QNs,
then a context may be needed for type inference. We write type(e) as the type of the domain element FEEL(e, c).
The java form of the mapping information indicates that the external function is to be accessed as a method on a Java
class. The class-name SHALL be the string name of a Java class on the classpath. Classpath configuration is
implementation-defined. The method-signature SHALL be a string consisting of the name of a public static method in
the named class, followed by an argument list containing only Java argument type names. The argument type
information SHOULD be used to resolve overloaded methods and MAY be used to detect out-of-domain errors before
runtime.
The pmml form of the mapping information indicates that the external function is to be accessed as a PMML model. The
IRI SHALL be the resource identifier for a PMML document. The model-name is optional. If the model-name is
specified, it SHALL be the name of a model in the document to which the IRI refers. If no model-name is specified, the
external function SHALL be the first model in the document.
When an externally-defined function is invoked, actual argument values and result value are converted when possible
using the type mapping table for Java or PMML [ref to this table in Types and Inference]. When a conversion is not
possible, null is substituted. If a result cannot be obtained, e.g., an exception is thrown, the result of the invocation is
null.
Passing parameter values to the external method or model requires knowing the expected parameter types. For Java, this
information is obtained using reflection. For PMML, this information is obtained from the mining schema and data
dictionary elements associated with independent variables of the selected model.
Note that DMN does not completely define the semantics of a Decision Model that uses externally-defined functions.
Externally-defined functions SHOULD have no side-effects and be deterministic.
An invocation of any FEEL function (built-in, user-defined, or externally-defined) can use positional parameters or
named parameters. If positional, all parameters SHALL be supplied. If named, unsupplied parameters are bound to null.
49 e1 or e2 or … FEEL(e1) or FEEL(e2) or …
Notice that we use bold syntax to denote contexts, lists, conjunctions, disjunctions, conditional expressions, true, false,
and null in the FEEL domain.
The meaning of the conjunction a and b and the disjunction a or b is defined by ternary logic. Because these are total
functions, the input can be true, false, or otherwise (meaning any element of D other than true or false).
a b a and b a or b
Negation is accomplished using the built-in function not. The ternary logic is as shown in Table 39.
a not(a)
true false
false true
otherwise null
kind/datatype e1 = e2
context contexts must have same set of keys K and e1.k = e2.k for every k in K.
range the ranges must specify the same endpoints and the same endpoint inclusivity
code.
function internal functions must have the same parameters, body, and scope. Externally
defined functions must have the same parameters and external mapping
information.
date and time all 7 components (10.3.2.3.5 date), treating unspecified optional components as
null, must be equal.
days and time duration value(e1) = value(e2). Value is defined in 10.3.2.3.7 days and time duration.
years and months duration value(e1) = value(e2). Value is defined in 10.3.2.3.8 years and months duration.
datatype e1 < e2
date and time valuedt(e1) < valuedt(e2). valuedt is defined in 10.3.2.3.5 date. If one input
has a null timezone offset, that input uses the timezone offset of the other
input.
time valuet(e1) < valuet(e2). valuet is defined in 10.3.2.3.4 time. If one input has
a null timezone offset, that input uses the timezone offset of the other input.
days and time duration valuedtd(e1) < valuedtd(e2). valuedtd is defined in 10.3.2.3.7 days and time
duration.
years and months duration valueymd(e1) < valueymd(e2). valueymd is defined in 10.3.2.3.8 years and
months duration.
FEEL supports additional syntactic sugar for comparison. Note that Grammar Rules (clause 10.3.1.2 Grammar rules) are
used in decision table condition cells. In Grammar Rule 51c, the qualified name must evaluate to a comparable constant
value at modeling time, i.e., the endpoint must be a literal or a named constant. These decision table syntaxes are defined
in Table 43.
Addition and subtraction are defined in Table 44 and Table 45. Note that if input values are not of the listed types, the
result is null.
21 e1 + e2 See below
22 e1 – e2 See below
date and time date and time Addition is undefined. Subtraction is defined as days and time
valuedtd-1(valuedt(e1)-valuedt(e2)), where valuedt is defined in duration
10.3.2.3.5 date and valuedtd-1 is defined in 10.3.2.3.7 days
and time duration.
years and years and valueymd-1(valueymd(e1) +/- valueymd(e2)) where valueymd and years and
months months valueymd-1 is defined in 10.3.2.3.8 years and months months duration
duration duration duration.
days and time days and time valuedtd-1(valuedtd(e1) +/- valuedtd(e2)) where valuedtd and days and time
duration duration valuedtd-1 is defined in 10.3.2.3.7 days and time duration. duration
date and time years and date and time (date(e1.year +/– e2.years + floor((e1.month date and time
months +/– e2.months)/12),
duration e1.month +/– e2.months – floor((e1.month +/– e2.months)/12)
* 12, e1.day), time(e1)),
where the named properties are as defined in Table 53
below, and the date, date and time, time and floor functions
are as defined in 10.3.4, valuedt and valuedt-1 is defined in
10.3.2.3.5 date and valueymd is defined in 10.3.2.3.8 years
and months duration.
years and date and time Subtraction is undefined. Addition is commutative and is date and time
months defined by the previous rule.
duration
date and time days and time valuedt-1(valuedt(e1) +/- valuedtd(e2)) where valuedt and date and time
duration valuedt-1 is defined in 10.3.2.3.5 and valuedtd is defined in
10.3.2.3.7 days and time duration.
days and time date and time Subtraction is undefined. Addition is commutative and is date and time
duration defined by the previous rule.
time days and time valuet-1(valuet(e1) +/- valuedtd(e2)) where valuet and valuet-1 time
duration is defined in 10.3.2.3.4 time and valuedtd is defined in
10.3.2.3.7 days and time duration.
days and time time Subtraction is undefined. Addition is commutative and is time
duration defined by the previous rule.
Multiplication and division are defined in Table 46 and Table 47. Note that if input values are not of the listed types, the
result is null.
23 e1 * e2 See below
24 e1 / e2 See below
years and number valueymd-1(valueymd(e1) * value(e2)) If value(e2)=0, the result is null. years and
months where valueymd and valueymd-1 are Else the result is months
duration defined in 10.3.2.3.7 days and time valueymd-1(valueymd(e1) / value(e2)) duration
duration. where valueymd and valueymd-1
are defined in 10.3.2.3.8 years and
months duration.
days and number valuedtd-1(valuedtd(e1) * value(e2)) If value(e2)=0, the result is null. days and
time where valuedtd and valuedtd-1 are Else the result is valuedtd- time
1
duration defined in 10.3.2.3.7 days and time (valuedtd(e1) * value(e2)) where duration
duration. valuedtd and valuedtd-1 are defined in
10.3.2.3.7 days and time duration.
Type-checking is defined in Table 49. Note that type is not mapped to the domain, and null is not the name of a type, and
null is not an instance of any type.
26 -e 0-e
Invocation is defined in Table 51. An invocation can use positional arguments or named arguments. If positional, all
arguments must be supplied. If named, unsupplied arguments are bound to null. Note that e can be a user-defined
function, a user-defined external function, or a built-in function.
Properties are defined in Table 52 and Table 53. If type(e) is date and time, time, or duration, and name is a property
name, then the meaning is given by Table 53. For example, FEEL(date and time("03-07-2012Z").year) = 2012.
date result is the named component of the date object e. year, month, day
Valid names are shown to the right.
date and time result is the named component of the date and time year, month, day, hour, minute,
object e. Valid names are shown to the right. time second, time offset, timezone
offset and timezone may be null
time result is the named component of the time object e. hour, minute, second, time offset,
Valid names are shown to the right. time offset and timezone
timezone may be null
years and months result is the named component of the years and years, months
duration months duration object e. Valid names are shown to
the right.
days and time result is the named component of the days and time days, hours, minutes, seconds
duration duration object e. Valid names are shown to the right.
56 e1[e2] list of items e such that i is in e iff i is e1 is a list and type(FEEL(e2, s')) is
in e1 and FEEL(e2, s') is true, where boolean
s' is the scope s with a special first
context containing the context entry
("item", i) and if i is a context, the
special context also contains all the
context entries of i.
56 e1[e2] [e1] if FEEL(e2, s') is true, where s' is e1 is not a list and not null and
the scope s with a special first context type(FEEL(e2, s')) is boolean
containing the context entry ("item",
e1) and if e1 is a context, the special
context also contains all the context
entries of e1. Else [].
{ n1 : e1, n2 : e2, …} { "n1": FEEL(e1, s1), "n2": FEEL(e2, s2), …} such that
the si are all s with a special first context ci containing a
59
{ "n1" : e1, "n2" : e2, …} subset of the entries of this result context. If ci contains
the entry for nj, then cj does not contain the entry for ni.
<e a="v"/> "e": { "@a": XV(v), attribute names are prefixed with
<c1>v1</c1> "c1": XV(v1), @. An element containing
<cn>v2</cn><cn>v3</cn> "cn": [ XV(v2), XV(v3) ] attributes or child elements →
</e> } context
An entry in the context entry in p column such as "e" : null indicates a context entry with string key "e" and value
null. The context entries are contained by context p that corresponds to the containing XML element, or to the XML
document itself.
The mapping does not replace namespace prefixes with the namespace IRIs. FEEL requires only that keys within a
context be distinct, and the namespace prefixes are sufficient.
number FEEL(v)
string FEEL("v")
element XE(v)
10.3.3.3.1 schema
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://www.example.org"
elementFormDefault="qualified">
<xsd:element name="Context">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Employee">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="salary" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Customer" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="loyalty_level" type="xsd:string"/>
<xsd:element name="credit_limit" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
10.3.3.3.2 instance
<Context xmlns:tns="http://www.example.org"
xmlns="http://www.example.org">
<tns:Employee>
<tns:salary>13000</tns:salary>
</tns:Employee>
<Customer>
Context
loyalty_level credit_limit
gold 10000
Customer
gold 20000
silver 5000
When a decision model is evaluated, its input data described by an item definition such as an XML Schema element
(clause 7.3.2 ItemDefinition metamodel) is bound to case data mapped to the FEEL domain. The case data can be in
various formats, such as XML. We can notate case data as an equivalent boxed context, as above. Decision logic can
reference entries in the context using expressions such as Context.tns$Employee.tns$salary, which has a value of 13000.
date(year, month, day) year, month, day creates a date from year, date(2012, 12, 25) = date("2012-12-25")
are numbers month, day component
values
date and time(date, time) date is a date or creates a date time from date and time ("2012-12-24T23:59:00") = date
date time; time is a the given date (ignoring and time (date("2012-12-24”),
time any time component) time(“T23:59:00"))
and the given time
date and time(from) date time string convert from to a date date and time("2012-12-24T23:59:00") +
and time duration("PT1M") = date and time("2012-12-
25T00:00:00")
duration(from) duration string convert from to a days date and time("2012-12-24T23:59:00") - date
and time or years and and time("2012-12-22T03:45:00") =
months duration duration("P2DT20H14M")
duration("P2Y2M") = duration("P26M")
years and months both are date and return years and months years and months duration(
duration(from, to) time duration between from date("2011-12-22"), date("2013-08-24") ) =
and to duration("P1Y8M")
1. grouping SHALL be one of space (' '), comma (','), period ('.'), or null.
decimal SHALL be one of period, comma, or null, but SHALL NOT be the same as the grouping separator unless
both are null.
from SHALL conform to grammar rule 37, after removing all occurrences of the grouping separator, if any, and after
changing the decimal separator, if present, to a period.
substring before string, string return substring of substring before("foobar", "bar") = "foo"
(string, match) string before the match
substring before("foobar", "xyz") = ""
in string
substring after string, string return substring of substring after("foobar", "ob") = "ar"
(string, match) string after the match in
substring after("", "a") = ""
string
contains(string, match) string does the string contain contains("foobar", "of") = false
the match?
starts with(string, match) string does the string start with starts with("foobar", "fo") = true
the match?
ends with(string, match) string does the string end with ends with("foobar", "r") = true
the match?
matches(input, pattern, string2 does the input match the matches("foobar", "^fo*b") = true
flags?) regexp pattern?
1. start position must be a non-zero integer (0 scale number) in the range [-L..L], where L is the length of the string.
length must be in the range [1..E], where E is L – start position if start position is positive,
and –start position otherwise.
2. pattern, replacement, and flags SHALL conform to the syntax and constraints specified in clause 7.6 of XQuery 1.0
and XPath 2.0 Functions and Operators. Note that where XPath specifies an error result, FEEL specifies a null result.
and(list) (list of) Boolean return false if any item is false, and([false,null,true]) = false
items else true if all items are true,
and(b1,…, bN), N >1 and(false,null,true) = false
else null
and([]) = true
and(0) = null
or(list) (list of) Boolean return true if any item is true, or([false,null,true]) = true
items else false if all items are false,
or(b1,…, bN), N >1 or(false,null,true) = true
else null
or([]) = false
or(0) = null
sublist(list, start position, list, number1, return list of length (or all) sublist([1,2,3], 1, 2) = [2]
length?) number2 elements of list, starting with
list[start position]. 1st position
is 1, last position is -1
append(list, item…) list, any element return new list with items append([1], 2, 3) = [1,2,3]
including null appended
insert before(list, list, number1, any return new list with newItem insert before([1,3],1,2) = [1,2,3]
position, newItem) element including inserted at position
null
remove(list, position) list, number1 list with item at position remove([1,2,3], 2) = [1,3]
removed
1. position must be a non-zero integer (0 scale number) in the range [-L..L], where L is the length of the list
2. length must be in the range [1..E], where E is L – start position if start position is positive,
and –start position otherwise.
decimal(n, scale) number, number1 return n with given scale decimal(1/3, 2) = .33
decimal(1.5, 0) = 2
decimal(2.5, 0) = 2
input expression list a list of the N>=0 input expressions in display order
outputs* a name (a string matching grammar rule 27) or a list of M>0 names
output values* if outputs is a list, then output values is a list of lists of values, one list
per output; else output values is a list of values for the one output.
Each value is a string.
rule list a list of R>0 rules. A rule is a list of N input entries followed by M
output entries. An input entry is a unary tests literal. An output entry is
an expression.
hit policy* one of: "U", "A", “P”, “F”, "R", "O", "C", "C+", "C#", "C<", “C>”
(default is "U")
default output value* if outputs is a list, then default output value is a context with entries
composed of outputs and output values; else default output value is one
of the output values.
Unary tests (grammar rule 17) are used to represent both input values and input entries. An input expression e is said to
satisfy an input entry t (with optional input values v), depending on the syntax of t, as follows:
grammar rule 17.a: FEEL(e in (t))=true
grammar rule 17.b: FEEL(e in (t))=false
grammar rule 17.c when v is not provided: e != null
grammar rule 17.c when v is provided: FEEL(e in (v))=true
A rule with input entries t1,t2,…,tN is said to match the input expression list [e1,e2,…,eN] (with optional input values list
[v1,v2,…vN]) if ei satisfies ti (with optional input values vi) for all i in 1..N.
A rule is hit if it is matched and the hit policy indicates that the matched rule's output value should be included in the
decision table result. Each hit results in one output value (multiple outputs are collected into a single context value).
Therefore, multiple hits require aggregation.
The hit policy is specified using the initial letter of one of the following boldface policy names.
Single hit policies:
Unique – only a single rule can be matched
Any – multiple rules can match, but they all have the same output
Priority – multiple rules can match, with different outputs. The output that comes first in the supplied output
values list is returned
First – return the first match in rule order
The aggregation is defined using the following built-in functions specified in 10.3.4.4 List functions: sum, count,
minimum, maximum. To reduce complexity, decision tables with compound outputs do not support aggregation and
support only the following hit policies: Unique, Any, Priority, First, Collect without operator, and Rule order.
A decision table may have no rule hit for a set of input values. In this case, the result is given by the default output value,
or null if no default output value is specified. A complete decision table SHALL NOT specify a default output value.
The semantics of a decision table invocation DTI are as follows:
1. Every rule in the rule list is matched with the input expression list. Matching is unordered.
2. If no rules match,
a. if a default output value d is specified, DTI=FEEL(d)
b. else DTI=null.
3. Else let m be the sublist of rules that match the input expression list. If the hit policy is "First" or "Rule order", order
m by rule number.
a. Let o be a list of output expressions, where the expression at index i is the output expression from rule m[i].
The output expression of a rule in a single output decision table is simply the rule's output entry. The output
expression of a multiple output decision table is a context with entries composed from the output names and
the rule's corresponding output entries. If the hit policy is "Output order", the decision table SHALL be
single output and o is ordered consistent with the order of the output values.
b. If a multiple hit policy is specified, DTI=FEEL(aggregation(o)), where aggregation is one of the built-in
functions sum, count, minimum as specified in 10.3.4.4 List functions.
c. else DTI=FEEL(o[1]).
10.3.4.7 Sort
Sort a list using an ordering function. For example,
sort(list: [3,1,4,5,2], precedes: function(x,y) x < y) = [1,2,3,4,5]
such that bkmi, dei and doi are partially ordered by requirements (e.g. the context entry for a required decision comes
before a decision that requires it).
The execution semantics of D is FEEL(F): a function that when invoked with values from the FEEL semantic domain
bound to the parameters representing input data and input decisions, returns a context consisting of all the output
decisions' output values.
XML elements SHALL map to the FEEL semantic domain as specified in 10.3.3 XML Data. Otherwise, details of the
syntax of input/output data values and mapping to/from FEEL are undefined.
10.5 Metamodel
The class Expression is extended to support the four new kinds of boxed expressions introduced by FEEL, namely:
Context, FunctionDefinition, Relation and List.
Boxed expressions are Expressions that have a standard diagrammatic representation [AF1] (see 7.2.1 Expressions and
10.2.1 Boxed Expressions). FEEL contexts, function definitions, relations and lists SHOULD be modeled as Context,
FunctionDefinition, Relation and List elements, respectively, and represented as a boxed expression
whenever possible; that is, when they are top-level expressions, since an instance of LiteralExpression cannot
contain another Expression element.
A Context element is represented diagrammatically as a boxed context (clause 10.2.1.4 Boxed Context). A FEEL
context (grammar rule 59 and clause 10.3.2.6 Context) SHOULD be modeled as a Context element whenever possible.
Context inherits all the attributes and model associations from Expression. Table 65 presents the additional
attributes and model associations of the Context element.
Attribute Description
Attribute Description
Attribute Description
FormalParameter: InformationItem [*] This attributes lists the instances of InformationItem that are
the parameters of this Context.
body: Expression [0..1] The instance of Expression that is the body in this
FunctionDefinition.
List inherits all the attributes and model associations from Expression. Table 68 presents the additional attributes
and model associations of the List element.
Attribute Description
element: Expression [*] This attributes lists the instances of Expression that are the
elements in this List.
Relation inherits all the attributes and model associations from Expression. Table 69 presents the additional
attributes and model associations of the Relation element.
Attribute Description
row: List [*] This attributes lists the instances of List that compose the rows
of this Relation.
column: InformationItem [*] This attributes lists the instances of InformationItem that
define the columns in this Relation.
10.6 Examples
A good way to get a quick overview of FEEL is by example.
FEEL expressions may reference other FEEL expressions by name. Named expressions are contained in a context.
Expressions are evaluated in a scope, which is a list of contexts in which to resolve names. The result of the evaluation is
an element in the FEEL semantic domain.
10.6.1 Context
Figure 68 shows the boxed context used for the examples. Such a context could arise in several ways. It could be part of
the decision logic for a single, complex decision. Or, it could be a context that is equivalent to part of a DRG as defined
in 10.4 Execution Semantics of Decision Services , where applicant, requested product, and credit history are input data
instances, monthly income and monthly outgoings are sub-decisions, and PMT is a business knowledge model.
applicant age 51
maritalStatus "M"
Notice that there are 6 top-level context entries, represented by the six rows of the table. The value of the context entry
named 'applicant' is itself a context, and the value of the context entry named 'monthly' is itself a context. The value of
the context entry named 'monthly outgoings' is a list, the value of the context entry named 'credit history' is a relation,
i.e., a list of two contexts, one context per row. The value of the context entry named 'PMT' is a function with parameters
'rate', 'term', and 'amount'.
The following examples use the above context. Each example has a pair of equivalent FEEL expressions separated by a
horizontal line. Both expressions denote the same element in the semantic domain. The second expression, the ‘answer,’
is a literal value.
10.6.2 Calculation
monthly income * 12
120000
The context defines monthly income as applicant.monthly.income, which is also defined in the context as 10,000. Twelve
times the monthly income is 120,000.
10.6.3 If, In
if applicant.maritalStatus in ("M","S") then "valid" else "not valid"
"valid"
The in test determines if the left hand side expression satisfies the list of values or ranges on the right hand side. If
satisfied, the if expression returns the value of the then expression. Otherwise, the value of the else expression is
returned.
A function is invoked textually using a parenthesized argument list after the function name. The arguments are defined in
the context, and are 0.25, 36, and 100,000, respectively.
This is a complex "one-liner" that will be useful to expand into constituent sub-expressions:
· built-in: sum
o path expression ending in .weight
§ filter: [record date > date("2011-01-01")]
· name resolved in context: credit history
An expression in square brackets following a list expression filters the list. Credit history is defined in the context as a
relation, that is, a list of similar contexts. Only the last item in the relation satisfies the filter. The first item is too old. The
path expression ending in .weight selects the value of the weight entry from the context or list of contexts satisfied by the
filter. The weight of the last item in the credit history is 150. This is the only item that satisfies the filter, so the sum is
150 as well.
The some expression determines if at least one element in a list or relation satisfies a test. There are no bankruptcy events
in the credit history in the context.
11 DMN Example
Note that in this example two decision points (automated as calls to decision services) are represented in BPMN 2.0 as
business rule tasks; the third decision point (which is human decision-making) is represented as a user task.
It might be considered more convenient to draw separate (but overlapping) DRDs for the three decision points:
All four DRDs – Figure 70, Figure 71, Figure 72 and Figure 73 – are views of the same DRG.
The DRG depicted in these DRDs shows dependencies between the following decisions:
The Strategy decision, requiring the Bureau call type and Pre-bureau eligibility decisions, invokes the Strategy
table shown in Figure 76 (without that table being encapsulated in a business knowledge model).
The Bureau call type decision, requiring the Pre-bureau risk category decision, invokes the Bureau call type
table shown in Figure 78.
The Eligibility decision, requiring Applicant data and the Pre-bureau risk category and Pre-bureau affordability
decisions, invokes the Eligibility rules shown in Figure 80.
The Pre-bureau affordability decision, requiring Applicant data and the Pre-bureau risk category and
Required monthly installment decisions, invokes the Affordability calculation boxed expression shown in
Figure 91, which in turn invokes the Credit contingency factor table shown in Figure 92.
The two decision services required by the business process model may now be defined against the decision model. The
Bureau Strategy Decision Service, called by the Decide bureau strategy task, has output decisions {Bureau call type,
Strategy}, and is shown in Figure 74. The Routing Decision Service, called by the Decide routing task, has output
decisions {Routing}, and is shown in Figure 75.
The Affordability calculation decision logic (Figure 91) defines a boxed function deriving Affordability from
Monthly Income, Monthly Repayments, Monthly Expenses and Required Monthly Installment. One step in this
calculation derives Credit contingency factor by invoking the Credit contingency factor table business
knowledge model, passing the output of the Risk category decision as the Risk Category parameter.
The Credit contingency factor table decision logic (Figure 92) defines a complete, unique-hit decision table
deriving Credit contingency factor from Risk Category.
The Required monthly installment decision logic (shown as a boxed invocation in Figure 93) invokes the
Installment calculation business knowledge model, passing Requested product . ProductType as the Product
Type parameter, Requested product . Rate as the Rate parameter, Requested product . Term as the Term
parameter, and Requested product . Amount as the Amount parameter.
The Installment calculation decision logic (Figure 94) defines a boxed function deriving monthly installment
from Product Type, Rate, Term and Amount. One step in this calculation invokes an external function PMT,
equivalent to the PMT calculation defined in Figure 68.
Strategy
1 INELIGIBLE - DECLINE
2 FULL, MINI BUREAU
3 ELIGIBLE NONE THROUGH
Eligibility
Eligibility rules
Age Applicant data . Age
Pre-Bureau Risk Pre-bureau risk category
Category
Pre-Bureau Pre-bureau affordability
Affordability
Eligibility rules
Eligibility
Pre-Bureau Pre-Bureau Age
P
Risk Category Affordability INELIGIBLE,
ELIGIBLE
1 DECLINE - - INELIGIBLE
2 - false - INELIGIBLE
3 - - < 18 INELIGIBLE
4 - - - ELIGIBLE
Application Pre-Bureau
U Existing Customer
Risk Score Risk Category
1 < 100 HIGH
2 [100..120) MEDIUM
3 [120..130] LOW
4 false > 130 VERY LOW
5 < 80 DECLINE
6 [80..90) HIGH
7 [90..110] MEDIUM
8 true > 110 LOW
Marital
Age Employment Status
Status Partial
C+
UNEMPLOYED, EMPLOYED, SELF-EMPLOYED, score
[18..120] S, M STUDENT
1 [18..21] - - 32
2 [22..25] - - 35
3 [26..35] - - 40
4 [36..49] - - 43
5 >=50 - - 48
6 - S - 25
7 - M - 45
8 - - UNEMPLOYED 15
9 - - STUDENT 18
10 - - EMPLOYED 45
11 - - SELF-EMPLOYED 36
Routing
Routing rules
Bankrupt Bureau data . Bankrupt
Routing rules
Pre-bureau affordability
Post-bureau affordability
Affordability calculation
Monthly Income Applicant data . Monthly . Income
Monthly Applicant data . Monthly . Repayments
Repayments
Monthly Applicant data . Monthly . Expenses
Expenses
Risk Category Post-bureau risk category
Required Monthly Required monthly installment
Installment
Affordability calculation
(Monthly Income, Monthly Repayments, Monthly Expenses, Risk Category, Required Monthly Installment)
Disposable Monthly Income – (Monthly Repayments + Monthly Expenses)
Income
Credit Credit contingency factor table
Contingency
Factor Risk Category Risk Category
Affordability if Disposable Income * Credit Contingency Factor > Required Monthly Installment
Credit
U Risk Category Contingency
Factor
1 HIGH, DECLINE 0.6
2 MEDIUM 0.7
3 LOW, VERY LOW 0.8
Applicant data
Age 51
MaritalStatus M
EmploymentStatus EMPLOYED
ExistingCustomer false
Monthly Income 10,000.00
Repayments 2,500.00
Expenses 3,000.00
Requested product
ProductType STANDARD LOAN
Rate 0.08
Term 36
Amount 100,000.00
Bureau data
Bankrupt false
CreditScore 600
When the Bureau Strategy Decision Service is called with the Applicant data and Requested product case data, it returns
the context shown in Figure 98:
Strategy THROUGH
When the Routing Decision Service is called with the Applicant data, Requested product and Bureau data case data, it
returns the context shown in Figure 99.
Routing ACCEPT
12 Exchange Formats
12.1 Interchanging Incomplete Models
It is common for DMN models to be interchanged before they are complete. This occurs frequently when doing iterative
modeling, where one user (such as a knowledge source expert or business user) first defines a high-level model and then
passes it on to another person to complete or refine the model.
Such "incomplete" models are ones in which not all of the mandatory model attributes have been filled in yet or the
cardinality of the lower bound of attributes and associations has not been satisfied.
XMI allows for the interchange of such incomplete models. In DMN, we extend this capability to interchange of XML
files based on the DMN XML-Schema. In such XML files, implementers are expected to support this interchange by:
Disregarding missing attributes that are marked as "required" in the DMN XML-Schema.
Reducing the lower bound of elements with "minOccurs" greater than 0.
Each file SHALL declare a “namespace” that MAY differ between multiple files of one model.
DMN files MAY import non-DMN files (such as XSDs and PMMLs) if the contained elements use external definitions.
If the path component in the URI reference is relative, the base URI against which the relative reference is applied is
determined as specified in [RFC 3986]. According to that specification, “if no base URI is embedded and the
representation is not encapsulated within some other entity, then, if a URI was used to retrieve the representation, that
URI shall be considered the base URI” ([RFC 3986], section 5.1.3). That is, if the reference is not in the scope of an
xml:base attribute [XBASE], a value of the href attribute that contains only a fragment and no path component
references a DMN element that is defined in the same instance of XML file as the referencing element. In the example
below, assuming that the requiredDecision element is not in the scope of an xml:base attribute, the DMN
element whose id is “prebureauriskDec01” must be defined in the same XML document:
<requiredDecision href=”#prebureauriskDec01” />
Notice that the BPMN processes and tasks that use a decision are referenced using the href attribute as well: indeed, it
is compatible with the system to reference external Process and Task instances in BPMN 2.0 Definitions, which is
also based on IDs.
References to datatypes (XSD attribute @typeRef) are by name, not ID. In order to support imported types, @typeRef is
type QName, in which the prefix refers to the namespace of the imported XSD or DMN file. To reference base types and
non-imported ItemDefinitions, the prefix may be omitted.
Goal 1: “The primary goal of BPMN is to provide a notation that is readily understandable by all business
users, from the business analysts that create the initial drafts of the processes, to the technical developers
responsible for implementing the technology that will perform those processes, and finally, to the business
people who will manage and monitor those processes. Thus, BPMN creates a standardized bridge for the gap
between the business process design and process implementation.”. DMN users will also be business analysts
(designing decisions) and then business users (populating decision models such as decision tables). Technical
developers may be responsible for mapping business terms to appropriate data technologies. Therefore DMN
can also be said to bridge the decision design by a business analyst, and the decision implementation, typically
using some decision execution technology.
In the latter case, decisions are used to determine which subprocesses or tasks are to be executed (in the process sense).
As such, DMN complements BPMN as decision modeling complements process modeling (in the sense of defining
orchestrations or work tasks).
For example, Figure 100 shows an example[1] of a BPMN-defined process.
From this example we can see that even a simple business process in BPMN may have several decision-making tasks.
[1] Shipment Process in a Hardware Retailer example, Ch5.1, BPMN 2.0 By Example, June 2010, OMG reference
10-06-02
A future version of BPMN may choose to clarify and extend the definitions of task to better match decision modeling
requirements and DMN – to wit, to define a BPMN Decision Task as some task used to make a decision modeled with
DMN. In the meantime, the Business Rule Task is the most natural way to express this functionality. However, as noted in
clauses 5.2.2 Modeling requirements for automated decision-making and 6.3.6 Artifact metamodel , a Decision in DMN
can be associated with any Task, allowing for flexibility in implementation.
· A Decision is not associated with Tasks that are part of Processes not also associated with the Decision.
· A Decision is not associated with Tasks that are not part of any Process associated with the Decision.
During development it may be appropriate to associate a Decision only with a Process, but inconsistency between Task
and Process associations is not allowed.
Note that this approach allows the relationships between business process models and decision models to be defined and
validated, but does not of itself permit the decisions modeled in DMN to be executed automatically by processes modeled
in BPMN.
b) Decision Services
One approach to decision automation is described non-normatively in Annex A: the encapsulation of DMN Decisions in a
“decision service” called from a BPMN Task (e.g., a Service Task or Business Rule Task, as discussed in Annex A.3
above). The usingProcesses and usingTasks properties allow definition and validation of associations between
BPMN and DMN; the definition of decision services then provides a detailed specification of the required interface.
Annex B: Glossary
(informative)
Any A hit policy for single hit decision tables with overlapping decision
rules: under this policy any match may be used.
B
Binding In an invocation, the association of the parameters of the invoked
expression with the input variables of the invoking expression, using a
binding formula.
Boxed Expression A notation serving to decompose decision logic into small pieces which
may be associated graphically with elements of a DRD.
Boxed Function A form of boxed expression showing the kind, parameters and body of
a function.
Boxed Invocation A form of boxed expression showing the parameter bindings that
provide the context for the evaluation of the body of a business
knowledge model.
Business Context Element An element representing the business context of a decision: either an
organisational unit or a performance indicator.
Business Knowledge Model Some decision logic (e.g., a decision table) encapsulated as a reusable
function, which may be invoked by decisions or by other business
knowledge models.
C
Clause In a decision table, a clause specifies a subject, which is defined by an
input expression or an output domain, and the finite set of the sub-
domains of the subject’s domain that are relevant for the piece of
Collect A hit policy for multiple hit decision tables with overlapping decision
rules: under this policy all matches will be returned as a list in an
arbitrary order. An operator can be added to specify a function to be
applied to the outputs: see Aggregation.
Crosstab Table An orientation for decision tables in which two input expressions
form the two dimensions of the table, and the output entries form a
two-dimensional grid.
D
Decision The act of determining an output value from a number of input values,
using decision logic defining how the output is determined from the
inputs.
Decision Logic The logic used to make decisions, defined in DMN as the value
expressions of decisions and business knowledge models and
represented visually as boxed expressions.
Decision Logic Level The detailed level of modeling in DMN, consisting of the value
expressions associated with decisions and business knowledge
models.
Decision Requirements Graph A graph of DRG elements (decisions, business knowledge models and
input data) connected by requirements.
Decision Requirements Level The more abstract level of modeling in DMN, consisting of a DRG
represented in one or more DRDs.
Definitions A container for all elements of a DMN decision model. The interchange
of DMN files will always be through one or more Definitions.
DMN Element Any element of a DMN decision model: a DRG Element, Business
Context Element, Expression, Definitions, Element Collection,
Information Item or Item Definition.
E
Element Collection Used to define named groups of DRG elements within a Definitions.
F
FEEL The “Friendly Enough Expression Language” which is the default
expression language for DMN.
First A hit policy for single hit decision tables with overlapping decision
rules: under this policy the first match is used, based on the order of the
decision rules.
Formal Parameter A named, typed value used in the invocation of a function to provide an
information item for use in the body of the function.
H
Hit In a decision table, the successful matching of all input expressions of
a decision rule, making the conclusion eligible for inclusion in the
results.
Horizontal An orientation for decision tables in which decision rules are presented
as rows; clauses as columns.
Input Data Denotes information used as an input by one or more decisions, whose
value is defined outside of the decision model.
Input Entry An expression defining a condition cell in a decision table (i.e., the
intersection of a decision rule and an input clause).
Input Expression An expression defining the item to be compared with the input entries
of an input clause in a decision table.
Input Value An expression defining a limited range of expected values for an input
clause in a decision table.
Item Definition Used to model the structure and the range of values of input data and
the outcome of decisions, using a type language such as FEEL or XML
Schema.
K
Knowledge Requirement The dependency of a decision or business knowledge model on a
business knowledge model which must be invoked in the evaluation of
its decision logic.
Knowledge Source An authority defined for decisions or business knowledge models, e.g.,
domain experts 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.
L
Literal Expression Text that represents decision logic by describing how an output value is
derived from its input values, e.g., in plain English or using the default
expression language FEEL.
M
Multiple Hit A type of decision table which may return output entries from multiple
O
Organisational Unit A business context element representing the unit of an organization
which makes or owns a decision.
Output Entry An expression defining a conclusion cell in a decision table (i.e., the
intersection of a decision rule and an output clause).
Output Order A hit policy for multiple hit decision tables with overlapping decision
rules: under this policy all matches will be returned as a list in
decreasing priority order. Output priorities are specified in an ordered
list of values.
Output Value An expression defining a limited range of domain values for an output
clause in a decision table.
P
Performance Indicator A business context element representing a measure of business
performance impacted by a decision.
Priority A hit policy for single hit decision tables with overlapping decision
rules: under this policy the match is used that has the highest output
priority. Output priorities are specified in an ordered list of values.
R
Relation A form of boxed expression showing a vertical list of homogeneous
horizontal contexts (with no result cells) with the names appearing just
once at the top of the list, like a relational table.
Requirement Subgraph The directed graph resulting from the transitive closure of the
requirements of a DRG element; i.e., the sub-graph of the DRG
representing all the decision-making required by a particular element.
Rule Order A hit policy for multiple hit decision tables with overlapping decision
rules: under this policy all matches will be returned as a list in the order
of definition of the decision rules.
Single Hit A type of decision table which may return the output entry of only a
single decision rule.
U
Unique A hit policy for single hit decision tables in which no overlap is
possible and all decision rules are exclusive. Only a single rule can be
matched.
V
Variable Represents a value that is input to a decision, in the description of its
decision logic, or a value that is passed as a parameter to a function.
Vertical An orientation for decision tables in which decision rules are presented
as columns; clauses as rows.
W
Well-Formed Used of a DRG element or requirement to indicate that it conforms to
constraints on referential integrity, acyclicity, etc.