cancel
Showing results for 
Search instead for 
Did you mean: 

Add an ExecutionListener via the Java API

jonathan1
Champ in-the-making
Champ in-the-making
I'd like to add an ExecutionListener to update a table when any process instance completes.

Is there a way to add an ExecutionListener from the JavaAPI, or alternatively in the ProcessEngine configuration?  I'd like not to alter process definitions to specify the listener.
4 REPLIES 4

naag
Champ in-the-making
Champ in-the-making
You can do it by implementing a custom BpmnParseListener and registering that via activiti.cfg.xml (property customPostBPMNParseListeners). There are some examples on the forums for that 🙂

jonathan1
Champ in-the-making
Champ in-the-making
Thanks, naag.  Adding to the processEngineConfiguration bean
<property name="customPostBPMNParseListeners">
    <list>
        <bean class="my.class.name.ListenerImpl" />
    </list>
</property>
in the Activiti configuration file worked well.

blezek
Champ on-the-rise
Champ on-the-rise
This method seems to have gone away.  Is there a new recommended approach?

jbarrez
Star Contributor
Star Contributor
These have been renamed to 'parse handlers', see http://activiti.org/userguide/index.html#advanced_parseHandlers for the new way of doing the same thing.