Unable to parse model using DMN model api

Hi ,

I am reading the .dmn file as an inputstream but while trying to get DmnModelInstance object using DMN model api am getting the below error:

****org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class *****
****** org.camunda.bpm.engine.ProcessEngineException: ENGINE-08043 Exception while performing ‘Deployment of Process Application DMN_Camunda’ => ‘Invoking @PostDeploy’: Unable to parse model ******

Is it possible to add new row in dmn table using dmn model api.
can someone give ideas on this.

Thanks and Regards,
Vinu S

Yes, it is. Please have a look at the example.

Best regards,
Philipp

Hi Philipp_Ossler,

I am able to parse now and add the input entries. Input type may be different right like integer,string,date.

Is there any specific way to give the types of inputs.

Am not able to find the newly added input entry in my dmn table.

when i try to evaluate the value for the new entry am getting null.

any idea on this.

Regards,
Vinu S

Hi @vinu_s,

can you please share your source code?
Otherwise, it’s hard to say what’s wrong :slight_smile:

please find the below code:

i have dmn table and i want to add a new row.

        Rule rule = dmnModelInstance.newInstance(Rule.class);

	InputEntry inputEntry = dmnModelInstance.newInstance(InputEntry.class);
	inputEntry.setTextContent("\"Rainy\"");
	

	int count = 5;
	InputEntry inputEntry1 = dmnModelInstance.newInstance(InputEntry.class);
	inputEntry1.setTextContent(">"+count);

	OutputEntry outputEntry = dmnModelInstance.newInstance(OutputEntry.class);
	outputEntry.setTextContent("\"soup\"");
	
	rule.getInputEntries().add(inputEntry);
	rule.getInputEntries().add(inputEntry1);
	rule.getOutputEntries().add(outputEntry);
	decisionTable.getRules().add(rule);

after deploying the process i get the follwoing response in tomcat server:

seasonguestCount"Fall"<= 8"Pasta"“Winter”> 8"Hot Maggie"Save money"Summer"[5…8]“Icecream"Less effort"Fall”, “Winter”, “Spring”>= 10"Chappathi"“Rainy”>5"soup"

new entry is added to the decision table but while evaluating

  VariableMap variables = Variables.createVariables().putValue("season", "Rainy").putValue("guestCount", 6);
	DmnDecisionTableResult dishDecisionResult = decisionService.evaluateDecisionTableByKey("dish")
			.variables(variables).evaluate();
	String desiredDish = dishDecisionResult.getSingleEntry();
	System.out.println("Desired dish: " + desiredDish);

am getting the desiredDish :null

i could not find the new entry in the table as well (in cockpit).

Please have a look at the example again.

You can’t set the text directly of the input/output entry. You need a Text element. See https://github.com/camunda/camunda-engine-dmn-benchmark/blob/master/src/main/java/org/camunda/bpm/dmn/engine/benchmark/util/DecisionTableGenerator.java#L92