Hi,
I created a service task with multiInstanceLoopCharacteristics. It is working fine but I found that task instances are executed sequentially not concurrently although I set isSequential="false" .
The task configuration is
<serviceTask id="XXX" name="XXX" activiti:delegateExpression="${xxx}" activiti:exclusive="false">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="xxxList" activiti:elementVariable="xxxRequest"></multiInstanceLoopCharacteristics>
</serviceTask>
The engine is 5.16.4 . The project is with spring framework.
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"
depends-on="dataSource,transactionManager">
<property name="databaseType" value="h2" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="create-drop" />
<property name="jobExecutorActivate" value="false" />
<property name="history" value="full" />
<property name="deploymentResources" value="classpath*:activiti/*.bpmn" />
</bean>
I tried adding sleep and long loop in task code and the tasks are always executed in sequential.
From log I can see task instances are created at the same time. However, somehow they are executed in order.
13:01:16.881 [DefaultThreadPool-2] DEBUG o.a.e.i.b.b.MultiInstanceActivityBehavior - Multi-instance 'Activity(XXXTask)' initialized. Details: loopCounter=0, nrOrCompletedInstances=0,nrOfActiveInstances=4,nrOfInstances=4
13:01:16.881 [DefaultThreadPool-2] DEBUG o.a.e.i.p.entity.ExecutionEntity - Child execution ScopeExecution[38] created with parent
13:01:16.881 [DefaultThreadPool-2] DEBUG o.a.e.i.b.b.MultiInstanceActivityBehavior - Multi-instance 'Activity(XXXTask)' initialized. Details: loopCounter=1, nrOrCompletedInstances=0,nrOfActiveInstances=4,nrOfInstances=4
13:01:16.881 [DefaultThreadPool-2] DEBUG o.a.e.i.p.entity.ExecutionEntity - Child execution ScopeExecution[39] created with parent
13:01:16.881 [DefaultThreadPool-2] DEBUG o.a.e.i.b.b.MultiInstanceActivityBehavior - Multi-instance 'Activity(XXXTask)' initialized. Details: loopCounter=2, nrOrCompletedInstances=0,nrOfActiveInstances=4,nrOfInstances=4
13:01:16.881 [DefaultThreadPool-2] DEBUG o.a.e.i.p.entity.ExecutionEntity - Child execution ScopeExecution[40] created with parent
13:01:16.881 [DefaultThreadPool-2] DEBUG o.a.e.i.b.b.MultiInstanceActivityBehavior - Multi-instance 'Activity(XXXTask)' initialized. Details: loopCounter=3, nrOrCompletedInstances=0,nrOfActiveInstances=4,nrOfInstances=4
Is there any high level configuration in engine needs to set? Can someone please help? Thanks.