AnsweredAssumed Answered

Update custom tables along with Activiti Tables

Question asked by subashini on Jun 6, 2016
Latest reply on Jun 20, 2016 by subashini
We are updating custom table using listener in the user task, service task and Email task , as part of our workflow. We are using the same transaction manager for both Activiti and the Custom tables. But even then, when there is a error in the listener, Activiti is not getting committed, but the local tables are committed with partial data.

Activiti Version : 5.15.1
Weblogic: 12.2.1

This is our activiti-config.xml
<code>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      
        xmlns:jee="http://www.springframework.org/schema/jee"
        xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/jee
            http://www.springframework.org/schema/jee/spring-jee.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
   
    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="jdbc/appDS"/>
    </bean>
   
    <bean id="workflowDbDAO" class="db.WorkflowDbDAOImpl">   
       <property name="dataSource" ref="dataSource" />
    </bean>
   

    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
       <property name="dataSource" ref="dataSource" />
     </bean>
   
   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">      
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
       <property name="databaseType" value="oracle" />
       <property name="databaseSchemaUpdate" value="true" />      
      
       <property name="history" value="audit" />
       <property name="jobExecutorActivate" value="true"/>      
      
       <property name="mailServerUseTLS" value="true" />
          
   </bean>
   
   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean" destroy-method="destroy">
     <property name="processEngineConfiguration" ref="processEngineConfiguration" />
  </bean>
 
  <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
  <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
  <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
  <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
  <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
  <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
</beans>
<code>

Any pointers is highly appreciated. It is causing lot of confusion, when a error occurs.

Outcomes