Hi,
I am trying to evaluate a decision inside a 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.
// 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);
the easiest way to evaluate a decision inside a process is to use a business rule task. It invokes the DMN engine and handles all the variable and result stuff.
Hello @Philipp_Ossler,
Thanks a lot for replying.
I am evaluating the pros and cons of using a business rule task vs delegate for a decision for our project. I have few queries regarding that. Would you be so kind enough to answer them.
Is there some place I can see what are the pros and cons of each approach
Is there a “Getting Started” page for business rule task that I can use
I get an “DMN-02003 Unable to transform decisions from input stream.” error when trying to deploy the decision before evaluating it. How can I get this resolved.
Thanks.
@Philipp_Ossler:
Yes, it does help me.
I will check my model to see if there is any discrepancy, and update this message otherwise.
Some of the code snippets for using a decision doesnt show a deployment of the model. So, is a deployment necessary before evaluating the result.
when you use a business rule task then you have to deploy the decision definition first. It’s similar to processes - you have to deploy a process definition before you can start a new instance of it.