DMN Scala Plugin Support

Hi team,

I am working on a project that will involve teams developing policies that will very likely require complex DMN Business Knowledge Models. I’m starting out by testing the example here DMN is more than a Decision Table | Camunda and attempting to use the scala plugin alongside the camunda-engine-spring package but have not had luck yet. I am seeing the following error message when I attempt to deploy the contract ranking example detailed in the blog:

‘DMN-02001 The expression type ‘ContextImpl’ of the decision ‘Ranking’ is not supported. The decision will be ignored.’

While I see that the scala plugin libraries are being added when I run “mvn dependency:tree”, this error message suggests that the scala plugin might not be getting utilized correctly.

I noticed that the code example from the blog (https://github.com/saig0/camunda-engine-unittest/blob/8967e4d206c4a4e35c09017b613e899c03bcc88d/pom.xml#L35) is not importing the camunda-engine-spring maven package, so am wondering is it possible to use the scala plugin alongside the spring package as I am attempting? Any guidance is greatly appreciated.

Also wondering if including support for processing DMN Business Knowledge models without requiring a plugin in a future release is on your roadmap?

Thanks,
Jake

I’ve made some progress on the effort by updating my spring configuration so that I include the SpringProcessEngineConfiguration is set with the CamundaDmnEnginePlugin and SpinProcessEnginePlugin. I also updated my pom.xml to exclude the camunda-engine-feel-scala jar from the camunda-engine-spring dependency to avoid a conflict. But with those changes in place I’m now getting the below error. Any guidance is very helpful, thanks.

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. [main] 04 May 2020 14:27:44,247 ERROR LoggingFailureAnalysisReporter [{}]:

APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.camunda.dmn.camunda.plugin.CamundaDmnEnginePlugin.postInit(CamundaDmnEnginePlugin.scala:38)

The following method did not exist:

org.camunda.bpm.engine.impl.history.parser.HistoryDecisionEvaluationListener.<init>(Lorg/camunda/bpm/engine/impl/history/producer/DmnHistoryEventProducer;Lorg/camunda/bpm/engine/impl/history/HistoryLevel;)V

The method’s class, org.camunda.bpm.engine.impl.history.parser.HistoryDecisionEvaluationListener, is available from the following locations:

jar:file:/Users/{username}/.m2/repository/org/camunda/bpm/camunda-engine/7.13.0-alpha3/camunda-engine-7.13.0-alpha3.jar!/org/camunda/bpm/engine/impl/history/parser/HistoryDecisionEvaluationListener.class

It was loaded from the following location:

file:/Users/{username}/.m2/repository/org/camunda/bpm/camunda-engine/7.13.0-alpha3/camunda-engine-7.13.0-alpha3.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.camunda.bpm.engine.impl.history.parser.HistoryDecisionEvaluationListener

1 Like

Hi @jbruce,

great progress :+1:

DMN-Scala depends on an older version of Camunda BPM (7.11.0) and it seems that one of the classes has changed. I need to upgrade the dependent version and build a new release of the DMN-Scala engine.

Best regards,
Philipp

Awesome, this worked great. Looking forward to the next Scala engine build :+1:

I have just one more quick followup question, I have not had any luck yet opening the .dmn file mentioned in your blog (https://raw.githubusercontent.com/saig0/camunda-engine-unittest/dmn-scala/src/test/resources/contract-ranking.dmn) in any modeling tool. It seems to not open correctly in the Camunda Modeler or on the dmn-js website. Is there a certain modeling tool that you recommend using?

Thank you for your prompt response!

Best regards,
Jake

I can’t. Sorry :sweat_smile:

Currently, the Camunda modeler doesn’t support all DMN elements (e.g. context, BKM, etc.). I didn’t used the other tools long enough to give a recommendation.

Hi Philipp
I was wondering about the state of the DMN-Scala engine. As there is no release for the newer Camunda Versions and also no Release for Scala 2.13.

Regards Pascal

Hi @pme123,

yes, it didn’t work on the DMN engine for a while. I don’t get requests or see much interest in it.

However, I will schedule a new release to update the dependencies :slight_smile:

Best regards,
Philipp

1 Like

Hi @Philipp_Ossler,
It is a bit confusing, as with 7.13 the DMN engine now supports the FEEL engine entirely - does it? What is the additional benefit now for this project? As I understand it, Camunda puts a lot of effort in the DMN Engine for the next releases.

Regards Pascal (a Scala Enthusiast :smile:)

1 Like

Correct :+1:

Currently, the Camunda DMN doesn’t support all DMN elements. It covers the most common cases with decision tables and literal expressions.

But for example, BKMs or Contexts are not supported. Also, it allows more advanced patterns, like iterating over a list and invoking a BKM for each element.

My initial idea of this project was to cover the major DMN specification and pass most of the DMN TCK.

You can see it as a playground of what you can do with DMN :smiley:

1 Like