I am deploying simple dmn file created by camunda modeller (4.2.0, UPDATE same with 4.12.0 Release Date: January 18, 2022):
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" id="Definitions_0sib65s" name="DRD" namespace="http://camunda.org/schema/1.0/dmn" exporter="Camunda Modeler" exporterVersion="4.2.0">
<decision id="Decision_1qnsi7h" name="Decision 1">
<informationRequirement id="InformationRequirement_1n68q12">
<requiredInput href="#InputData_0cvdsfu" />
</informationRequirement>
<decisionTable id="DecisionTable_1o6i63n">
<input id="Input_1">
<inputExpression id="InputExpression_1" typeRef="string">
<text></text>
</inputExpression>
</input>
<output id="Output_1" typeRef="string" />
</decisionTable>
</decision>
<inputData id="InputData_0cvdsfu" />
<dmndi:DMNDI>
<dmndi:DMNDiagram>
<dmndi:DMNShape dmnElementRef="Decision_1qnsi7h">
<dc:Bounds height="80" width="180" x="160" y="100" />
</dmndi:DMNShape>
<dmndi:DMNShape id="DMNShape_0cj7rh9" dmnElementRef="InputData_0cvdsfu">
<dc:Bounds height="45" width="125" x="198" y="298" />
</dmndi:DMNShape>
<dmndi:DMNEdge id="DMNEdge_17tvn8k" dmnElementRef="InformationRequirement_1n68q12">
<di:waypoint x="261" y="298" />
<di:waypoint x="250" y="200" />
<di:waypoint x="250" y="180" />
</dmndi:DMNEdge>
</dmndi:DMNDiagram>
</dmndi:DMNDI>
</definitions>
but it fails with error:
java.lang.RuntimeException: org.camunda.bpm.engine.ProcessEngineException: ENGINE-08043 Exception while performing 'Deployment of Process Application application' => 'Deployment of process archive 'null': ENGINE-22004 Unable to transform DMN resource 'bpmn/diagram_1.dmn'.
...
Caused by: org.xml.sax.SAXException: Error: URI=null Line=2: cvc-elt.1.a: Cannot find the declaration of element 'definitions'.
Deployment is via resource in standard spring boot project with dependency:
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
<version>3.4.0</version>
</dependency>
This error did come up multiple times on internet:
- On camunda forum itself user does not know how/if he solved this issue.
- Other search result also does not have answer.
- In general looking into "Cannot find the declaration of element" error (f.e. here on SE ) I do not see any issue with the dmn file - it has default xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" and also namespace="http://camunda.org/schema/1.0/dmn" declared correctly AFAIK.
- Here it is suggested to change the namespace so I used <definitions xmlns="http://www.omg.org/spec/DMN/20151101/dmn11.xsd" but that does not seem to match xml file created by camunda modeller (cvc-complex-type.3.2.2: Attribute 'id' is not allowed to appear in element 'informationRequirement') but it seems to helped with 'definitions' element (Not sure why)?.
BPMN files created and deployed same way are working without issues! They are a bit different - ...<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"... but that should be ok in my knowledge.