Error calling DeploymentBuilder.deployWithResult with dmn

I created a basic DMN diagram with the latest Camunda Modeler and attempting to deploy via DeploymentBuilder.deployWithResult, however it logs the following error. I am using 7.10.0/7.10.4-ee.

Ideas?

Caused by: org.camunda.bpm.model.dmn.DmnModelException: Unable to parse model
	at org.camunda.bpm.model.dmn.impl.DmnParser.parseModelFromStream(DmnParser.java:70)
	at org.camunda.bpm.model.dmn.Dmn.doReadModelFromInputStream(Dmn.java:240)
	at org.camunda.bpm.model.dmn.Dmn.readModelFromStream(Dmn.java:155)
	at org.camunda.bpm.dmn.engine.impl.transform.DefaultDmnTransform.setModelInstance(DefaultDmnTransform.java:110)
	... 36 common frames omitted
Caused by: org.camunda.bpm.model.xml.ModelParseException: SAXException while parsing input stream
	at org.camunda.bpm.model.xml.impl.util.DomUtil.parseInputStream(DomUtil.java:244)
	at org.camunda.bpm.model.xml.impl.parser.AbstractModelParser.parseModelFromStream(AbstractModelParser.java:97)
	at org.camunda.bpm.model.dmn.impl.DmnParser.parseModelFromStream(DmnParser.java:67)
	... 39 common frames omitted
Caused by: org.xml.sax.SAXException: Error: URI=null Line=11: cvc-elt.1.a: Cannot find the declaration of element 'definitions'.
	at org.camunda.bpm.model.xml.impl.util.DomUtil$DomErrorHandler.error(DomUtil.java:201)
...

@bruce.downs Welcome to the forum :partying_face:

Verify that your dmn xml has the below <definitions></definitions> tags.

<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/" id="Definitions_13auk4i" name="DRD" namespace="http://camunda.org/schema/1.0/dmn">
....

</definitions>

Java API:

DmnModelInstance modelInstance = Dmn.createEmptyModel();

Definitions definitions = modelInstance.newInstance(Definitions.class);
definitions.setNamespace("http://camunda.org/schema/1.0/dmn");
definitions.setName("definitions");
definitions.setId("definitions");

Decision decision = modelInstance.newInstance(Decision.class);
decision.setId("testGenerated");
decision.setName("generationtest");

definitions.addChildElement(decision);

modelInstance.setDefinitions(definitions);

Hey Aravindh, thanks for responding!

I used a simple dmn file generated using the latest Camunda Modeler. See attached.

Btw, I’ve tried several variations produced with the Camunda Modeler.

Note, I am able to successfully deploy this example - https://github.com/camunda/camunda-bpm-examples/blob/master/dmn-engine/dmn-engine-java-main-method/src/main/resources/org/camunda/bpm/example/dish-decision.dmn11.xml.

Test_Workflow_4.dmn (878 Bytes)

I have been experimenting and believe upgrading from 7.10 to 7.14 will solve the problem.

Please confirm.

Which version of camunda modeler are you using?

If you’re using camunda modeler version >4.2.x,then you might consider to upgrade the Camunda version to the latest otherwise downgrade the Camunda modeler.

Hi @bruce.downs,

the current Modeler (4.3.0) enables DMN 1.3, which is only available in recent Camunda BPM Platform versions: https://docs.camunda.org/manual/7.14/installation/camunda-modeler/#matching-camunda-process-engine-version.

I would recommend to do the upgrade on the engine.

If you can’t, step back to Modeler 3.7.2.

Hope this helps, Ingo