-
1. Re: Loop on JBPM6 Timers
swiderski.maciej May 4, 2015 4:42 AM (in response to durani163)you can use ISO date format to do what you need without any loops or additional process variables. For your use case it should be enough to set this value for timer cycle event definition:
R5/PT30S
HTH
-
2. Re: Loop on JBPM6 Timers
durani163 May 4, 2015 5:37 AM (in response to swiderski.maciej)Hi Maciej,
Thanks a lot for your response. I have already tried to implement the above scenario with ISO date format and did not succeed on it. Hence, I have opted for the above implementation.
Below is the scenario that I have tried for loop on JBPM timers.
In this scenario I just have a user task which has to timeout after 30S and need to execute script task for five times at 30s interval. I have configured exactly what you have mentioned. But couldn't be able to proceed further on the same.
I am guessing there might be some problem in quartz properties. Please find the quartz configuration.
org.quartz.scheduler.instanceName = TestScheduler
org.quartz.scheduler.instanceId = instance_one
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.idleWaitTime=1000
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 1
org.quartz.threadPool.threadPriority = 5
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreCMT
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties=false
org.quartz.jobStore.dataSource=myDS
org.quartz.jobStore.nonManagedTXDataSource=notManagedDS
org.quartz.jobStore.tablePrefix=QRTZ_
org.quartz.jobStore.isClustered=true
org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.dataSource.myDS.jndiURL=java:comp/env/jdbc/jbpm
org.quartz.dataSource.notManagedDS.jndiURL=java:comp/env/jdbc/jbpm
Thanks in Advance,
Feroze
-
3. Re: Loop on JBPM6 Timers
durani163 May 4, 2015 11:00 AM (in response to durani163)In addition to the above quartz configuration, below is the jbpm configuration with spring.
1. jbpm-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"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"><bean id="jbpmEMF" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="org.jbpm.persistence.spring.local" />
<property name="persistenceXmlLocation" value="classpath:spring/persistence-local.xml"/>
</bean><bean id="jbpmEM" class="org.springframework.orm.jpa.support.SharedEntityManagerBean">
<property name="entityManagerFactory" ref="jbpmEMF" />
</bean><bean id="jbpmTxManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="jbpmEMF" />
</bean><bean id="process" factory-method="newClassPathResource" class="org.kie.internal.io.ResourceFactory">
<constructor-arg>
<value>sample/sampleTimerUserTask1.bpmn</value>
</constructor-arg>
</bean>
<bean id="taskService" class="org.kie.spring.factorybeans.TaskServiceFactoryBean" destroy-method="close">
<property name="entityManagerFactory" ref="jbpmEMF"/>
<property name="transactionManager" ref="jbpmTxManager"/>
<property name="userGroupCallback" ref="customUserGroupCallback"/>
<property name="listeners">
<list>
<bean class="org.jbpm.services.task.audit.JPATaskLifeCycleEventListener" />
</list>
</property>
</bean><bean id="runtimeEnvironment" class="org.kie.spring.factorybeans.RuntimeEnvironmentFactoryBean">
<property name="type" value="DEFAULT"/>
<property name="entityManagerFactory" ref="jbpmEMF"/>
<property name="entityManager" ref="jbpmEM"/>
<property name="transactionManager" ref="jbpmTxManager"/>
<property name="schedulerService" ref="timerService"/>
<!-- <property name="registerableItemsFactory" ref="workItems"/> -->
<property name="assets">
<map>
<entry key-ref="process"><util:constant static-field="org.kie.api.io.ResourceType.BPMN2"/></entry>
</map>
</property>
<property name="taskService" ref="taskService"/>
</bean><bean id="runtimeManager" class="org.kie.spring.factorybeans.RuntimeManagerFactoryBean" destroy-method="close">
<property name="identifier" value="spring-rmf"/>
<property name="runtimeEnvironment" ref="runtimeEnvironment"/>
<property name="type" value="PER_PROCESS_INSTANCE"/>
</bean><bean id="customUserGroupCallback" class="com.trials.jbpm.process.beans.CustomUserGroupCallback"/>
<bean id="customWorkItemHandler" class="com.trials.jbpm.process.beans.HelloProcessExtension"/>
<bean id="timerService" class="org.jbpm.process.core.timer.impl.QuartzSchedulerService"/>
</beans>Thanks In Advance,
Feroze
-
4. Re: Loop on JBPM6 Timers
swiderski.maciej May 14, 2015 2:15 AM (in response to durani163)you should use only one event definition - meaning either timer cycle or timer duration. I'd recommend use timer cycle only with ISO format and it should work as expected as there are number of test cases proving this works.
HTH