Deploying a Decision
To deploy a DMN decision you can either use the Repository Service or add it to a process application. The platform will recognize all files with a.dmn or
.dmn11.xml file extension as DMN resources.
Deploying a decision using the Repository Service
Use the Repository Service to create a new deployment and add DMN resources to it. The following code, for example, will create a new deployment for a DMN file in the classpath.Deploying a decision with a Process Application
If you deploy a Process Application, you can add the DMN file to your archive as other resources, like BPMN processes. The DMN files must have a.dmn or .dmn11.xml file extension to be recognized as DMN resource.
If your Process Archive is set up to scan for process definitions, it will
automatically deploy the DMN definitions too. This is the default.
Versioning of Decisions
When a DMN resource is deployed to the platform, every supported DMN Decision is transformed into a Decision Definition. A decision definition represents a single DMN decision in the platform. It has, among others, these attributes:id: The unique identifier of the Decision Definition generated by the platform.key: The DMN decisionidattribute from the XML file.name: The DMN decisionnameattribute from the XML file.version: The version of the Decision Definition generated by the platform.
The Decision Definition Key
The decision definition key is equivalent to theid attribute of the DMN
decision in the DMN XML.
id: GENERATEDkey:my-decisionname:My Decisionversion: 1
The Decision Definition Version
When a decision is deployed, it is checked whether a definition with the same key is already deployed. If not, the decision definition is assigned version1 for this key. If a decision definition with the same
key already exists, the newly deployed decision definition will become a new version of
the existing one, increasing its version by one.
This versioning of decision definitions allows the user to update decisions,
but still be able to use previous decision versions if needed.
The Decision Definition Id
The id of a decision definition is not equivalent to theid attribute of
the DMN XML decision. It is generated by the platform as unique identifier.
This means a decision definition id directly corresponds to a decision
definition key and version combination.
Reference a Decision Definition
To reference a deployed decision definition in the context of the platform, either the decision definition id or the decision definition key and version is used. If a decision definition key is used but no version is specified, the default is to use the latest version of the decision definition.Versioning of Decision Requirements Graph
In addition to the decision definitions, the decision requirements graph (i.e., thedefinitions element in the XML) of a deployed DMN resource is transformed into a Decision Requirements Definition. It has, among others, these attributes:
id: The unique identifier of the Decision Requirements Definition generated by the platform.key: The definitionsidattribute from the XML file.name: The definitionsnameattribute from the XML file.version: The version of the Decision Requirements Definition generated by the platform.
The Decision Requirements Definition Key
The decision requirements definition key is equivalent to theid attribute of the definitions element in the DMN XML.
id: GENERATEDkey:my-drgname:My DRGversion: 1
The Decision Requirements Definition Version
When a decision requirements graph is deployed, it is checked whether a definition with the same key is already deployed. If not, the decision requirements definition is assigned version1 for this key. If a decision requirements definition with the same
key already exists, the newly deployed definition will become a new version of
the existing one, increasing its version by one.
Note that the versions of the contained decision definitions can be different from the decision requirements definition if they are also deployed inside other DMN resources, as a single decision inside a DMN resource, or added later.
Querying the Decision Repository
All deployed decision definitions and decision requirements definitions can be queried by the repository service API.Querying Decision Definitions
Get a decision definition with the id “decisionDefinitionId”:Querying Decision Requirements Definitions
The decision requirements definitions can be queried in a similar way to the decision definitions.Authorizations for Querying the Decision Repository
The user needs theREAD permission on the resource DECISION_DEFINITION to
query decision definitions. This permission is also required to retrieve decision
definitions, decision models and decision diagrams from the repository. The
resource id of the authorization is the decision definition key.
To query decision requirements definitions, the user needs the READ permission on the resource DECISION_REQUIREMENTS_DEFINITION. The
resource id of the authorization is the key of the decision requirements definitions.
For more information about authorizations, please refer to the Authorization
Service section.