cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti CDI configuration not working with weblogic

vinothkumar_j2e
Champ in-the-making
Champ in-the-making
I am working on handling the process event.  So starting implementing the activiti CDI for handling events

Below is my configuration :

<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>

  <bean id="processEngineConfiguration" class="org.activiti.cdi.CdiJtaProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource" />
    <property name="databaseSchemaUpdate" value="true" />
    <property name="jobExecutorActivate" value="false" />
    <property name="transactionManager">
           <bean factory-bean="txManager"   factory-method="getTransactionManager" />
      </property>
      <property name="postBpmnParseHandlers">
        <list>
                <bean class="org.activiti.cdi.impl.event.CdiEventSupportBpmnParseHandler" />
        </list>
   </property>

Created sample class and jared the same to weblogic lib:

public void onProcessEvent(@Observes BusinessProcessEvent businessProcessEvent) {
        // handle event
      System.out.println("business event recieved "+businessProcessEvent.getProcessInstanceId());
}

now i am creating instance in activiti process and i dont see the events getting trigger or being listened i.e i dont see the SOP in weblogic  console. Please let me know if there is anything i am missing…

Thanks
5 REPLIES 5

vinothkumar_j2e
Champ in-the-making
Champ in-the-making
<![CDATA[

=====================
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>

<bean id="processEngineConfiguration" class="org.activiti.cdi.CdiJtaProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource" />
    <property name="databaseSchemaUpdate" value="true" />
    <property name="jobExecutorActivate" value="false" />
    <property name="transactionManager">
     <bean factory-bean="txManager" factory-method="getTransactionManager" />
  </property>
  <property name="postBpmnParseHandlers">
        <list>
                <bean class="org.activiti.cdi.impl.event.CdiEventSupportBpmnParseHandler" />
        </list>
</property>
  </bean>

]]>

vinothkumar_j2e
Champ in-the-making
Champ in-the-making
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>

<bean id="processEngineConfiguration" class="org.activiti.cdi.CdiJtaProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource" />
    <!– <property name="transactionManager" ref="txManager" /> –>
    <property name="databaseSchemaUpdate" value="true" />
    <property name="jobExecutorActivate" value="false" />
    <property name="transactionManager">
     <bean factory-bean="txManager" factory-method="getTransactionManager" />
  </property>
  <property name="postBpmnParseHandlers">
        <list>
                <bean class="org.activiti.cdi.impl.event.CdiEventSupportBpmnParseHandler" />
        </list>
</property>
  </bean>

trademak
Star Contributor
Star Contributor
Did you also add a beans.xml file in the META-INF folder of the JAR?
Also, did you add @ApplicationScoped to the class where you have the onProcessEvent method?

Best regards,

vinothkumar_j2e
Champ in-the-making
Champ in-the-making
yes i have beans.xml in META-INF & @ApplicationScoped on class . Still onProcessEvent is not getting invoked .Below are the details

============================================
import org.activiti.cdi.BusinessProcessEvent;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;

@ApplicationScoped
public class CDIEventListener implements Serializable {

private static final long serialVersionUID = 8464154944703808443L;

public void onProcessEvent(@Observes BusinessProcessEvent businessProcessEvent) {
        // handle event
  System.out.println("business event recieved "+businessProcessEvent.getProcessInstanceId());
}
}
============================================
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
 
  <interceptors>
    <class>org.activiti.cdi.impl.annotation.StartProcessInterceptor</class>
    <class>org.activiti.cdi.impl.annotation.CompleteTaskInterceptor</class>
  </interceptors>
</beans>

==========================================================

frederikherema1
Star Contributor
Star Contributor
You're sure the "org.activiti.cdi.impl.event.CdiEventSupportBpmnParseHandler" is used? Is it possible to debug that class to see what it does when the "handlers" are actually firing the event?