2 Replies Latest reply on Aug 4, 2011 3:14 AM by Ayusman Dikshit

    event handler method not getting invoked in jbpm

    Ayusman Dikshit Newbie


      I have a spring 3 and jbpm 4.4 integration environment.

      However in one of my tasks I have provided a event as per jpdl specs.


      My jpdl snippet with the task element looks like this:


          <task  name="TK1" 
                    description="A task that gets assigned to somebody with user name test" 
                  <on event="start">
                              <event-handler expr="#{myEventHandler}"/>
                  <on event="end">
                        <event-handler expr="#{myEventHandler}"/>
            <transition name="END"  to="END" g="-31,2"/>


      and the myEventHandler bean is created in spring as below:


          <bean id="myEventHandler" class="com.test.MyEventHandler">
              <!-- myBO bean is created in the spring application context file itself which contains code to insert/update data to DB-->
              <property name="myBO" ref="myBO"/>

      and my Event handler class looks like this:


          import org.jbpm.api.listener.EventListener;
          import org.jbpm.api.listener.EventListenerExecution;
          public class MyEventHandler implements EventListener {
              private MyBO myBO;
              public void notify(EventListenerExecution eventExecution) throws Exception
                  //Do some logical operation based on incoming process variable...
                  //Use the myBO bean to do DB operation...


      The problem is:

      after trying several options, the notify method NEVER gets executed. I see the tasks getting created in JBPM4_TASK table, but strangely I can not get  the notify() invoked. And there is no form of error or warning to be seen.


      Has anybody faced similar problems?

      Is there a way to resolve this?


      Any help is appreciated.