In my EjbProcessApplication I am using the default process engine with
processEngine = ProcessEngines.getDefaultProcessEngine();
an handle the deployment of my BPMN like this:
return processEngine.getRepositoryService()
.createDeployment()
.addClasspathResource(deploymentSource)
.source(deploymentSource)
.name(deploymentName)
.enableDuplicateFiltering(deployChangedOnly) // deploy nur bei Änderung
.deployWithResult();
This works as expected.
In my BPMN Model I have some listeners for a UserTask. All class listeners work also as expected. Only the delege listener results in a ProcessEngineException.
ENGINE-16004 Exception while closing command context: Unknown property used in expression: ${myStartExecutionListener}. Cause: Cannot resolve identifier 'myStartExecutionListener': org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: ${myStartExecutionListener}. Cause: Cannot resolve identifier 'myStartExecutionListener'
This is my camunda.cfg.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.impl.cfg.JtaProcessEngineConfiguration">
<property name="databaseSchemaUpdate" value="false" />
<property name="dataSourceJndiName" value="java:jboss/jdbc/Mis2DB" />
<property name="transactionManagerJndiName" value="java:jboss/TransactionManager" />
<property name="idGenerator">
<bean class="org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator" />
</property>
<property name="metricsEnabled" value="false"/>
<property name="dbMetricsReporterActivate" value="false" />
</bean>
</beans>
This is a snippet from my model:
<bpmn:userTask id="t_AnfrageErfassen" name="Anfrage erfassen">
<bpmn:extensionElements>
<camunda:executionListener delegateExpression="${myStartExecutionListener}" event="start" />
<camunda:executionListener class="at.luxbau.mis2.bpm.listener.MyEndExecutionListener" event="end" />
<camunda:taskListener class="at.luxbau.mis2.bpm.listener.MyCreateTaskListener" event="create" />
<camunda:taskListener class="at.luxbau.mis2.bpm.listener.MyCompleteTaskListener" event="complete" />
</bpmn:extensionElements>
This is my delegate expression listener:
@Named
public class MyStartExecutionListener implements ExecutionListener {
private final Logger LOGGER = Logger.getLogger(MyStartExecutionListener.class.getName());
@Override
public void notify(DelegateExecution execution) throws Exception {
LOGGER.info("+".repeat(80));
LOGGER.info(String.format("-> %s#notify()", getClass().getName()));
LOGGER.info(String.format("<- %s#notify()", getClass().getName()));
LOGGER.info("-".repeat(80));
}
}
and this is my class listener:
public class MyCreateTaskListener implements TaskListener {
private final Logger LOGGER = Logger.getLogger(MyCreateTaskListener.class.getName());
@Override
public void notify(DelegateTask delegateTask) {
LOGGER.info("+".repeat(80));
LOGGER.info(String.format("-> %s#notify()", getClass().getName()));
LOGGER.info(String.format("<- %s#notify()", getClass().getName()));
LOGGER.info("-".repeat(80));
}
}
How can I get the delegate listener working? In this context it is just a proof-of-concept, later i will use a delegate expression in some service tasks, where I need CDI Injection!
Thank you and regards,
Rainer