1

I am trying to evaluate a decision inside a camunda java delegate that I created. Following is the code that I am using. Upon executing the delegate( which runs fine without the DMN part), I get an error stating:

java.lang.NoClassDefFoundError: de/odysseus/el/util/SimpleContext"

I am using gradle and have added the following to my .build : compile 'org.camunda.bpm.dmn:camunda-engine-dmn' , 'org.camunda.bpm.dmn:camunda-engine-feel-juel:7.5.0-alpha2' , 'de.odysseus.juel:juel-spi:2.2.7', 'de.odysseus.juel:juel-api:2.2.7' , 'de.odysseus.juel:juel-impl:2.2.7'

Any suggestion how can I fix this error up? Thanks.

DMN Code:

DmnEngine dmnEngine = DmnEngineConfiguration.createDefaultDmnEngineConfiguration().buildEngine();

// read the DMN XML file as input stream
InputStream inputStream = CheckDatafileExistsExecutor.class.getResourceAsStream("decision1.xml");

// parse the DMN decision from the input stream
DmnDecision decision = dmnEngine.parseDecision("Decision_13nychf", inputStream);

//accessing the input variables
VariableMap variables = Variables.fromMap((Map<String, Object>) decision);

// evaluate the decision table with the input variables
DmnDecisionTableResult result = dmnEngine.evaluateDecisionTable(decision, variables);

int size = result.size();
DmnDecisionRuleResult ruleResult = result.get(0);
4

2 Answers 2

2

Remove all your dependencies and add only compile group: 'org.camunda.bpm.dmn', name: 'camunda-engine-dmn', version: '7.6.0'

You can try also menskis example, but change the camunda-engine-dmn to 7.6.0 and

DmnDecisionTableResult results = dmnEngine.evaluateDecisionTable("decision", "Example.dmn", variables);

to

    InputStream fileAsStream = IoUtil.fileAsStream("Example.dmn");
    DmnDecisionTableResult results = dmnEngine.evaluateDecisionTable("decision", fileAsStream, variables);
Sign up to request clarification or add additional context in comments.

Comments

0

You can use delegate service for decision evaluation based on key or Id,

eg:-

public void execute(DelegateExecution delegateExecution) throws Exception{ DecisionService decisionService = delegateExecution.getProcessEngineServices().getDecisionService(); decisionService.evaluateDecisionByKey(dmnToInvoke).variables(delegateExecution.get Variables()).evaluate(); }

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.