Dmn table error -ClassNotFoundException de.odysseus.el.util.SimpleContext

I am trying to use BPMN with DMN capability of camunda. but when i start process i got this error:
ClassNotFoundException de.odysseus.el.util.SimpleContext
here is my code:
package org.camunda.bpm.getstarted.dmn;
import java.io.InputStream;

import org.camunda.bpm.dmn.engine.DmnDecision;
import org.camunda.bpm.dmn.engine.DmnDecisionRuleResult;
import org.camunda.bpm.dmn.engine.DmnDecisionTableResult;
import org.camunda.bpm.dmn.engine.DmnEngine;
import org.camunda.bpm.dmn.engine.DmnEngineConfiguration;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.camunda.bpm.engine.variable.VariableMap;
import org.camunda.bpm.engine.variable.Variables;

public class InputDesicionData implements JavaDelegate {
	public void execute(DelegateExecution execution) throws Exception {
		// TODO Auto-generated method stub
		String value = (String) execution.getVariable("subProcess1");
		Boolean needTestCard = (Boolean) execution.getVariable("testCard");
//		DecisionService decisionService = processEngine.getDecisionService();
		VariableMap variables = Variables.createVariables().putValue("subProcess1", value).putValue("test",
				needTestCard);
//		DmnDecisionTableResult process =  decisionService
//				.evaluateDecisionTableByKey("ProcessTable", variables);
//		String chosenProcess = process.getSingleEntry();
		DmnEngine dmnEngine = DmnEngineConfiguration
				  .createDefaultDmnEngineConfiguration()
				  .buildEngine();
		InputStream inputStream =InputDesicionData.class
	            .getResourceAsStream("subProcess.dmn");
		DmnDecision decision = dmnEngine.parseDecision("ProcessTable", inputStream);
		DmnDecisionTableResult tableResult = dmnEngine.evaluateDecisionTable(decision, variables);
		int size = tableResult.size();

		// get first matching rule
		DmnDecisionRuleResult ruleResult = tableResult.get(0);

		// get output values by name
		Object result = ruleResult.get("result");
		Object reason = ruleResult.get("reason");
		System.out.println("YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY");
		System.out.println(tableResult.getSingleResult());

		// collects only the entries for an output column
		System.out.println(tableResult.collectEntries("result"));
        System.out.println(size);
		execution.setVariable("subProcess1", ruleResult);
	}

}

and here are my dmn and bpm files:
subProcess.bpmn (13.9 KB)
SubProcess.dmn (2.5 KB)
I tried to make this process by dmnServices:
public class InputDesicionData implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
DecisionService decisionService = (DecisionService) processEngine.getDecisionService();

	String value = (String) execution.getVariable("subProcess1");
		Boolean needTestCard = (Boolean) execution.getVariable("testCard");
		DecisionService decisionService = processEngine.getDecisionService();
		VariableMap variables = Variables.createVariables().putValue("subProcess1", value).putValue("test",
				needTestCard);
		DmnDecisionTableResult process =  decisionService
				.evaluateDecisionTableByKey("ProcessTable", variables);
		String chosenProcess = process.getSingleEntry();
		execution.setVariable("subProcess1",chosenProcess);
		}

but in this case processDefinition was null .
Now i don’t have any idea which path is right for my process, and what am i missing in first example ( when i got this error:ClassNotFoundException de.odysseus.el.util.SimpleContext )
Which solution should i use and how should i write/update data in dmn table from javaDelegate?

Hi @Sally,

you get the ClassNotFoundException de.odysseus.el.util.SimpleContext because you built a new DMN engine and doesn’t use the existing one. You should use the decisionService.

Regarding the example with the decisionService, please verify that the DMN is deployed and the decision table has the id ProcessTable.

BTW, why don’t you use a business rule task?

Best regards,
Philipp

1 Like

Picking up this old thread, because I ran in the same problem when I tried testing DMN without the complete engine setup, as documented in Testing Decisions with the DMN Engine | docs.camunda.org

Is this still possible, and if so: what are the minimal dependency requirements to do so?