Hello,
I have a strange behaviour in my application concerning the CMMN Listeners, which I’m not sure if it’s a mistake on my part, or a bug in Camunda itself.
I have a rather large EJB/EAR application holding (among others) one Case Model and four Processes. Note: The Processes and the Case Model are being deployed automatically, when I deploy my application.
And here’s the thing: if the Case Model is not the last thing deployed (see picture), then the expression resolver will not be able to find the Listener beans. More specifically: I have a User Task connected to a Milestone, and the Milestone has a Case Execution Listener (Event Type: Occur, Listener Type: Delegate Expression, Delegate Expression: #{myListener}). When the user finishes the Task, the Listener is executed.
This works like a charm, if the Case Model is the last thing deployed. However, if a Process changes and gets redeployed, then the following exception gets thrown every time the Case Execution Listener should be executed:
Caused by: org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: #{myListener}. Cause: Cannot resolve identifier ‘myListener’
at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:60)
To fix the error, I need to a) manually redeploy the Case Model and then b) redeploy the application. After that, it works again. …at least the instances of the newly deployed Case do. The older instances of the previous versions are still throwing the Exception.
Is this normal? I can’t imagine it being intended behaviour. And if it’s a mistake on my side (maybe the placement of the beans in the EAR) then how come it works if the Case Model is the last thing deployed? I would assume the EL Resolver can either find my beans or not, and not depend on the deployment order. Java Delegates in BPMN Processes also work regardless of the process deployment order.
I’ve managed to reproduce this behaviour consistently on different WildFly 10 + Camunda 7.6.x, 7.7.x, etc. Versions.
Sadly, I haven’t had the time to prepare a test application, but maybe one of the devs can say something about this.
Thanks & best regards,
Raul