AnsweredAssumed Answered

ExecutionListener in BpmnModel

Question asked by gguimezanes on Jan 31, 2013
Latest reply on Feb 1, 2013 by jbarrez
I am working on an application in which we have our own internal model for representing a workflow but would like to delegate the core workflow processing to activiti.
Thus I am transorming our own model into a org.activiti.bpmn.model.BpmnModel, then transforming the model to xml using BpmnXmlConverter so that I can deploy the resulting xml in activiti engine.
I want to add executionListeners on all activities and intermediate catching events, so that I can update our own internal model when things happen.
I have run into several difficulties :

1) If I add an ExecutionListener on a UserTask, it is not taken into account in the XML converter (check BaseBpmnXmlConcerter.writeListeners and you will see that it takes oinly into account the taskListeners, not the executionListeners)
=> is that how Activiti works? Can we only have task listeners on user tasks, or is it a limitation on the xml converter only?

2) I don't seem to be able to add any listener to an IntermediateCatchEvent. The getExecutionListeners() method is defined on Activity and IntermediateCatchEvent is not in the same hierarchy.
=> on I saw that executionListeners were actually supposed to work with start and end of intermediate events, so I assume it's a limitation on the BpmnModel, not on the engine… or did I miss a way to do it?

3) Not a question, just a suggestion : my code is more difficult to write because there is no common interface between Process and SubProcess (for the addFlowElement method). Would be really great to create interfaces for the methods in common between objects that do not have the same hierarchy so that we can manipulate them more easily!