AnsweredAssumed Answered

Adding a BPMN Parser

Question asked by jatz on Mar 4, 2014
Latest reply on Mar 10, 2014 by frederikheremans1
We have a unit test where a service task needs to be mocked as it calls an external web service.

To get around this we have added a handler to the ProcessEngineConfiguration as below:

processEngineConfiguration.getBpmnParser().getBpmnParserHandlers().addHandler(new ExternalCheckMockHandler("mock"));

This looks to work fine, except that when we encounter a listener (as shown below). This ends up getting called twice instead of once:

<serviceTask id="testServiceTask" name="Test Service Task" activiti:expression="#{testService.updateStatus(execution.getProcessBusinessKey())}">
        <activiti:executionListener event="end" expression="#{testService.runListener(execution.getProcessBusinessKey())}"></activiti:executionListener>

The testService.runListener runs two times instead of once at the end of the service task.

Could someone please guide me on if the way this handler has been added is the correct way to go?