We have a process with an executionListener that worked under Version 5. After the migration to flowable 6.2.1 the listener gets no longer called.
Here a Unit Test that worked under Flowable 5:
@Test
public void testEndExecutionListener() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("myProcess");
Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
taskService.complete(task.getId());
assertEquals(pi.getProcessInstanceId(), listener.getPid());
}
@Component
public class TestListener {
private String pid;
public void processEndListener(DelegateExecution ex) {
pid = ex.getProcessInstanceId();
}
public String getPid() {
return pid;
}
}
And the simple process
<process id="myProcess" name="My process" isExecutable="true">
<extensionElements>
<activiti:executionListener event="end" expression="${testListener.processEndListener(execution)}">
</activiti:executionListener>
</extensionElements>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="terminateendevent1" name="TerminateEndEvent">
<terminateEventDefinition></terminateEventDefinition>
</endEvent>
<userTask id="usertask1" name="User Task"></userTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="usertask1" targetRef="terminateendevent1"></sequenceFlow>
</process>
</definitions>
Any Ideas what’s going wrong here?
Thanks
Wolfgang