Custom TaskLifecycleEventListener not picked up by TaskService if configured through Spring framework

Solution Unverified - Updated -

Issue

  • User developed a custom implementation of TaskLifeCycleEventListener class which implements the TaskLifeCycleEventListener interface like the following.
public class SimpleTaskLifeCycleEventListener implements TaskLifeCycleEventListener {

    @Override
    public void afterTaskStartedEvent(TaskEvent event) {}

    @Override
    public void afterTaskActivatedEvent(TaskEvent event) {}
...
}

And configured it as a Spring bean like this way.

...
    <bean id="taskService" class="org.kie.spring.factorybeans.TaskServiceFactoryBean" destroy-method="close">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="userGroupCallback" ref="userGroupCallback" />
        <property name="listeners">
            <list>
                <ref bean="simpleTaskLifeCycleEventListener"></ref> 
            </list>
        </property>
    </bean>
    <bean id="simpleTaskLifeCycleEventListener" class="com.sample.task.listener.SimpleTaskLifeCycleEventListener">
    </bean> 
<bean id="runtimeEnvironment"
        class="org.kie.spring.factorybeans.RuntimeEnvironmentFactoryBean">
        <property name="type" value="DEFAULT" />
        <property name="entityManagerFactory" ref="entityManagerFactory" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="assets">
                    ...
        </property>
        <property name="taskService" ref="taskService"/>
    </bean>
...

Unfortunately, this custom listener is never picked up by the TaskService. Is there a sample Spring based application which can demonstrate how to work with TaskLifecycleEventListener implementations in jBPM6 ?

Environment

  • Red Hat JBoss BPM Suite (BPMS)
    • 6.2.0
  • Spring Framework
    • 3.2.12

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content