我试图在我创建的camunda委托中评估一个决策。下面是我正在使用的代码。在执行委托(在没有DMN部分的情况下运行良好)时,我得到一个错误,声明:
java.lang.NoClassDefFoundError: de/odysseus/el/util/SimpleContext"
我正在使用gradle,并在我的.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'
有什么建议吗?我怎样才能纠正这个错误?谢谢。
DMN代码:
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);发布于 2017-03-23 06:15:07
删除所有依赖项,只添加compile group: 'org.camunda.bpm.dmn', name: 'camunda-engine-dmn', version: '7.6.0'
您也可以尝试门斯基示例,但是将camunda dmn更改为7.6.0和
DmnDecisionTableResult results = dmnEngine.evaluateDecisionTable("decision", "Example.dmn", variables);至
InputStream fileAsStream = IoUtil.fileAsStream("Example.dmn");
DmnDecisionTableResult results = dmnEngine.evaluateDecisionTable("decision", fileAsStream, variables);发布于 2022-04-08 10:31:25
您可以根据键或Id使用委托服务进行决策评估,
例:-
公共空执行(DelegateExecution delegateExecution)抛出异常{ DecisionService decisionService =delegateExecution变量().evaluate();}
https://stackoverflow.com/questions/42937898
复制相似问题