Activiti CDI configuration not working with weblogic

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2013 03:05 PM
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
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
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2013 03:15 PM
<![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>
]]>
=====================
<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>
]]>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2013 03:17 PM
<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>
<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>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2013 04:57 AM
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,
Also, did you add @ApplicationScoped to the class where you have the onProcessEvent method?
Best regards,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2013 10:16 AM
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>
==========================================================
============================================
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>
==========================================================
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2013 11:03 AM
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?
