AnsweredAssumed Answered

Repeat timers issue in Activiti 5.17.0

Question asked by durani163 on May 4, 2015
Latest reply on May 7, 2015 by durani163
Hi Guys,

I have been working on Repeat timers on a user task using ISO date format. I have mentioned time duration: PT30S & time cycle: R4/PT30S. Below is the simple use case that I have been trying in a standalone application (Spring 3.0.4 & Hibernate 4.2.12 & JPA as entity manager factory) with activity engine (5.17.0).

Start -> User Task (Boundary Timer with time duration: PT30S & time cycle: R4/PT30S) -> Service Task -> End.

As per the above use case, if the user do not  approve within 30S, then the timer should invoke and service task should get invoked 4 times at 30S interval. But I could not be able to get success in the repeat timers. Only once, the service task gets executed.

Below is my configuration with spring:

1. activit-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
                  http://www.springframework.org/schema/beans/spring-beans.xsd">
                  
   <bean id="dataSource"
      class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
      <property name="url" value="jdbc:oracle:thin:@10.132.10.55:1522:HRMSLCL2" />
      <property name="username" value="sysadm" />
      <property name="password" value="sysadm123" />
   </bean>
   
   <bean id="jpaMF" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="org.jbpm.persistence.spring.local" />
           <property name="persistenceXmlLocation" value="classpath:spring/persistence.xml"/>
           <property name="jpaVendorAdapter">
         <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
           <property name="databasePlatform" value="org.hibernate.dialect.Oracle10gDialect" />
         </bean>
           </property>
   </bean>

   <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
      <property name="entityManagerFactory" ref="jpaMF" />
   </bean>

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="true" />
      
      <property name="jpaEntityManagerFactory" ref="jpaMF" />
      <property name="jpaHandleTransaction" value="true" />
      <property name="jpaCloseEntityManager" value="true" />
      
      <property name="deploymentResources" value="classpath:sample/*.bpmn" />
        <property name="deploymentMode" value="single-resource" />
   </bean>

   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
      <property name="processEngineConfiguration" ref="processEngineConfiguration" />
   </bean>

   <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
   <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
   <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />

</beans>

2. Persistence.xml

<persistence
  version="2.0"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
                      http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
  xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://java.sun.com/xml/ns/persistence">

  <persistence-unit name="org.jbpm.persistence.spring.local" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
  
    <properties> 
      <property name="hibernate.id.new_generator_mappings" value="false" />
      <property name="hibernate.max_fetch_depth" value="3"/>
      <property name="hibernate.hbm2ddl.auto" value="update" />
      <property name="hibernate.show_sql" value="true" />
         
      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
      <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
      <property name="hibernate.connection.url" value="<connection url>"/>
      <property name="hibernate.connection.username" value="sa"/>
      <property name="hibernate.connection.password" value=""/>
               
    </properties>       
  </persistence-unit>
   
</persistence>

Please help me out if I am missing any configuration related to timers in activity.

Thanks,
Feroze



Outcomes