cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring ActivitiEventListener as managed bean (CDI)

miran
Champ in-the-making
Champ in-the-making
Hi,

I am using Activiti+CDI and need to register ActivitiEventListener. It works well if configured in activiti cfg xml:

 
    <bean id="processEngineConfiguration" class="org.activiti.cdi.CdiStandaloneProcessEngineConfiguration">
        ….
        <property name="eventListeners">
            <list>
                <bean class="mycompany.activiti.impl.ActivitiProcessListener" />
            </list>
        </property>
    </bean>



But if I need to configure my listener using CDI (injecting logger, services …), it doesn't work. I tried add annotation @Named to the class, but it doesn't help:


@Named
public class ActivitiProcessListener implements ActivitiEventListener {
   …
}


Is this use case supported?

Thx
Miran
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
No, I don't think so. You'd need to get your process engine or your engine configuration bean and add it programmatically.