AnsweredAssumed Answered

Adding an event listener

Question asked by esilkensen on Jun 13, 2016
Latest reply on Jun 20, 2016 by jbarrez
Hi,

Sorry for the basic question, I'm new to Activiti and Spring.

I'm trying to add a simple "Hello World" event listener from the guide (http://activiti.org/userguide/index.html#eventDispatcherListener) but haven't been able to get it working where I can see the output yet.

What I've done so far:

- Compile the MyEventListener class and package it in a JAR, and copy that JAR into activiti/tomcat/webapps/activiti-app/WEB-INF/lib
- Create a activiti.cfg.xml file and save it in activiti/tomcat/webapps/activiti-app/WEB-INF/classes with the contents:
<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.activiti.spring.SpringProcessEngineConfiguration">
    <property name="eventListeners">
      <list>
        <bean class="org.activiti.engine.example.MyEventListener" />
      </list>
    </property>
  </bean>
</beans>

Then after shutting down and restarting Activiti, stepping through a workflow, I haven't seen any output from MyEventListener.

Does this look right?  Am I missing any steps?

Thanks for any help.

Outcomes