cancel
Showing results for 
Search instead for 
Did you mean: 

JobExecution and sequential

jmalvarezf
Champ in-the-making
Champ in-the-making
Hi all,

I'm working with activiti 5.10 and jobexecutor but something is not working as expected.
I'm trying to execute a job each 5 minutes that must start (with a call activiti process) multiple other processes, but with the limitation imposed by poolSize in JobExecutor (in this case, 3 threads running). But it seems that my multiinstance defined is working as sequential, although it is not defined as sequential. I have also set exclusive to false with no different result.

This is the BPM code:

<callActivity id="addOrderIntoSGA" name="Add order into SGA" activiti:async="true" activiti:exclusive="false" calledElement="sgaOrderAddProcess">      <extensionElements>        <activiti:in sourceExpression="${order.getOrderid()}" target="orderId"></activiti:in>      </extensionElements>      <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="orders" activiti:elementVariable="order"></multiInstanceLoopCharacteristics>    </callActivity>‍‍‍‍‍‍‍‍

My Job executor configuration is as follows:

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">        <property name="dataSource" ref="xaActivitiDataSource" />        <property name="transactionManager" ref="transactionManager" />        <property name="databaseSchemaUpdate" value="false" />        <property name="jobExecutorActivate" value="true" />        <property name="jobExecutor">           <bean class="org.activiti.engine.impl.jobexecutor.DefaultJobExecutor">             <property name="corePoolSize" value="3"/>             <property name="maxPoolSize" value="3"/>             <property name="queueSize" value="3000" />         </bean>        </property>        <property name="history" value="activity" />        <property name="mailServerHost" value="service-smtp" />        <property name="mailServerDefaultFrom" value="activiti@2020mobile.es" />        <property name="idGenerator">            <bean class="org.activiti.engine.impl.persistence.StrongUuidGenerator" />        </property>    </bean>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


Does anyone know what is the problem, or what is happening?

Thank you all!
1 REPLY 1

jmalvarezf
Champ in-the-making
Champ in-the-making
Ok, I think I found the solution. It is clearly said here: http://forums.activiti.org/content/multiinstance-callactivity

So the problem was that that, although all was declared asynchronous, the transaction was not being commited, and thus, the job was not asynchronous at all.

Thank you all.