Parallel multi instance usertasks collection from service

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2012 09:39 AM
The example: (from http://activiti.org/userguide/index.html#bpmnMultiInstance)
The problem is that service "myService" method resolveUsersForTask are invoked multi-times.
In activiti-engine class method: org.activiti.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior.createInstances evaluate expresion values multi-times.
First resolving:
Second only for setting assignee (string value from collection) are invoked collectionExpression (myService.resolveUsersForTask()):
So totally this service are invoked collection.size()+1 times. May be in near future possible optimize this part?
<userTask id="miTasks" name="My Task" activiti:assignee="${assignee}"> <multiInstanceLoopCharacteristics isSequential="true" activiti:collection="${myService.resolveUsersForTask()}" activiti:elementVariable="assignee" > </multiInstanceLoopCharacteristics></userTask>
The problem is that service "myService" method resolveUsersForTask are invoked multi-times.
In activiti-engine class method: org.activiti.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior.createInstances evaluate expresion values multi-times.
First resolving:
int nrOfInstances = resolveNrOfInstances(execution);
Second only for setting assignee (string value from collection) are invoked collectionExpression (myService.resolveUsersForTask()):
for (int loopCounter=0; loopCounter<nrOfInstances; loopCounter++) { … executeOriginalBehavior(concurrentExecution, loopCounter); } }
So totally this service are invoked collection.size()+1 times. May be in near future possible optimize this part?
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2012 04:41 AM
Can someone comment this situation? Does there are any other way using UserTask for multi users, get in current state assignee's list from java service meanwhile this service retrieve list from third-party app using web-service. So calling myService.resolveUsersForTask() many times are unacceptable.
Regards,
Mindaugas
Regards,
Mindaugas
