cancel
Showing results for 
Search instead for 
Did you mean: 

Adding an event listener

esilkensen
Champ in-the-making
Champ in-the-making
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.
2 REPLIES 2

esilkensen
Champ in-the-making
Champ in-the-making
(It looks like the forum inserted an "a" tag in the xsi:schemaLocation after posting which isn't actually there)

jbarrez
Star Contributor
Star Contributor
That looks alright to me. How does your event listener look like?