Declaring variables with camunda dmn-modeler

Hi,

when I import a .dmn-file, designed with the camunda-dmn-modeler to a redhad-driven dmn-engine, I get the following error-message:

DMN: Decision node 'Decision 1' is missing the variable declaration (resource: 51a06510-371b-431c-a0f0-dde68937403d.dmn, DMN id: Decision_0defrxy, A variable declaration is missing)

How can I declare variables in the camunda-modeler?

Thanks in advance
Stefan

P.S.: The same happens when I import the dmn from the camunda-dmn-simulator (https://camunda.com/dmn/simulator/) which seemed to me complete for automation. Then the errormessage is multiplied to all decisions.

Mind sharing the DMN file?

2 Likes

I think the best example is the file from
https://camunda.com/dmn/simulator/

which I downloaded from the site to upload it hiere:
simulation.dmn (8.9 KB)

It generates the error message as follows:
The model could not be imported, the following errors have occurred:

DMN: Decision node 'Beverages' is missing the variable declaration (resource: 51a06510-371b-431c-a0f0-dde68937403d.dmn, DMN id: beverages, A variable declaration is missing)
DMN: Decision node 'Dish' is missing the variable declaration (resource: 51a06510-371b-431c-a0f0-dde68937403d.dmn, DMN id: dish, A variable declaration is missing)
DMN: Input Data node 'Season' is missing the variable declaration (resource: 51a06510-371b-431c-a0f0-dde68937403d.dmn, DMN id: InputData_0rin549, A variable declaration is missing)
DMN: Input Data node 'Number of Guests' is missing the variable declaration (resource: 51a06510-371b-431c-a0f0-dde68937403d.dmn, DMN id: InputData_1axnom3, A variable declaration is missing)
DMN: Input Data node 'Guests with children?' is missing the variable declaration (resource: 51a06510-371b-431c-a0f0-dde68937403d.dmn, DMN id: InputData_0pgvdj9, A variable declaration is missing)

I cannot reproduce this issue using the diagram you shared. I’m using Camunda Modeler v3.3.5.

Actually I try to upload the model to an alternative DMN-tester: declab,
(https://github.com/materna-se/declab/)
since there seems no way to use DMN-simulator on premise.

However, the question is: How can I declarate variables using camunda modeler?

I have the same problem. I created a .dmn file using the javascript editor on bpmn.io and then I wanted to import it in the drools KIE server but I get the following error:
0CD3C6B913D339B5FF8DA40840414C7E 2019-12-18 20:30:03,446 com.nemesis.platform.module.kie.core.service.impl.KieServiceImpl [https-jsse-nio-127.0.0.1-8112-exec-29] ERROR: Error: DMN: Input Data node 'Order Total' is missing the variable declaration (resource: credit-account-calculation.dmn, DMN id: InputData_1jm0c5f, A variable declaration is missing)

Can you upload your model?

Here it is:

Several things I did. I edited the XML at the top to include the feel and kie namespace. Then I noticed that the error is resolved once I add this to the inputData Order Total:

<variable id="orderTotal_ii" name="Order Total" typeRef="feel:double" />

and this to the inputData Number Of Orders:

<variable id="numberOfOrders_ii" name="Number Of Orders" typeRef="feel:integer" />

but this means that I manually have to change the XML. I was hoping that the DMN modeler’s properties panel would show them so I can edit them there - but it doesn’t :frowning:

After I added those two variables to the inputData the dmn file now fails with:

ERROR: Error: DMN: Decision node 'Calculate Credit Account Points' is missing the variable declaration (resource: credit-account-calculation.dmn, DMN id: CreditAccountCalculator, A variable declaration is missing) 

which tells me that I have to add a variable to the decision node too. Is there a way for the dmn properties panel to show those variables?

Any thoughts on this? One thing I noticed is that when I specify inputVariable in the table then it adds this camunda:inputVariable="orderTotal" to the xml. However, I still see no way to add xml element <variable/> to the <inputData/> through the modeler. Am I missing something?

I was able to deploy it without any problems to Camunda so it seems this is likely an issue with what drools is expecting from the XML. I don’t use drools so can’t really help here.