From the .bpmn file for the main process:
...
<bpmn2:serviceTask id="PopulateNodeList" activiti:class="PopulateNodeList" name="Populate Node List">
<bpmn2:incoming>SequenceFlow_20</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
</bpmn2:serviceTask>
...
<bpmn2:callActivity id="DoWorkOnNode" name="Do Work on Node" calledElement="DoWorkOnNode">
<bpmn2:extensionElements>
<activiti:in source="node" target="node"/>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_22</bpmn2:outgoing>
<bpmn2:multiInstanceLoopCharacteristics activiti:collection="${nodeList}" activiti:elementVariable="node"/>
</bpmn2:callActivity>
From glassfish domain.xml:
...
<thread-pool max-thread-pool-size="6"
name="platform-jobexecutor-tp"
min-thread-pool-size="3"
max-queue-size="10">
</thread-pool>
I was able to get past the ClassNotFoundException by adding some jars to my lib folder; however, once I ran it through again, it still looked like it ran things serially.
In my config I have the following:
<bpmn2:callActivity id="DoWorkOnNode" activiti:async="true" activiti:exclusive="false" name="Do Work On Node" calledElement="DoWorkOnNode">
<bpmn2:extensionElements>
<activiti:in source="node" target="node"/>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
<bpmn2:multiInstanceLoopCharacteristics activiti:collection="${nodeList}" activiti:elementVariable="node">
<bpmn2:loopCardinality xsi:type="bpmn2:tFormalExpression">3</bpmn2:loopCardinality>
</bpmn2:multiInstanceLoopCharacteristics>
</bpmn2:callActivity>
When we didn't set a value for loopCardinality, it just looped through 'nodeList' over and over running on each item serially until we killed glassfish. Right now, we're testing with a 'nodeList' with 3 items in it so we set loopCardinality to 3. That will execute DoWorkOnNode for each item in the list once and exit, but it doesn't do them in parallel. I guess there's two issues here...how do we set loopCardinality on the fly (programatically) depending on the size of 'nodeList'? Do we just need to set another process variable? That won't be too hard to try. And, the second issue...why isn't it executing them in parallel when we have async and exclusive set?
Hi John Richard,
> Why isn't it executing them in parallel when we have async and exclusive set?
The asynchronous continuation happens before the multi instance call activity is executed. This means that execution will stop before the call activity is reached and then resumed. Subsequently A SINGLE thread will execute the multi instance activity behavior and create the sub-executions for the individual instances. These are executed serially, by this very thread.
If you want to make the execution of the individual called process instances truly concurrent, you need to add an asynchronous continuation on the first activity in the called sub process. This way all instances will be created by the first thread and then continued concurrently. By multiple new threads:

Be aware that your process instances will potentially encounter optimistic locking exceptions when the finished executions of the multi instances should be joined in concurrent, interleaving transactions. So make sure that the last transaction in the subprocess does not have any non-transactional side effects.
(You could also consider using the retry interceptor
As a general thought: think about what you want to optimize for:
Intra-Process Instance Concurrency <> Inter Process Instance Concurrency
local vs. global throughput. Should a single instance finish fast or do you want to do may instances per time-unit?
Cheers,
Daniel Meyer
Project Lead
www.camunda.org/community/team.html
Maybe you can give me some guidance on the best way to go about this. We have our main process which, at a certain point, queries the database, forms a list which is saved as a Camunda process variable, then the multi-instance Call Activity (we'll call it X) is executed once against each of the entries in the list. The Call Activity is actually broken down into a couple other Call Activity's (let's call them Y & Z) which themselves have a handful of Service Task's. The total execution time of each X is going to be anywhere from 1-5 minutes. So, for example, if we have 4 nodes and let's say they run in 1 minute, 3 minutes, 2 minutes and 4 minutes, that's 10 minutes total if they run serially. If we can execute them in parallel, they're done in 4 minutes. Also, we want to be able to join when they're all done and run a couple more Service Task's in the main process.
By the way, thanks for the detail. We're going to try to make the inner Service Task's async and see if that achieves what we're looking for.
John
Hi John,
If I understand you correctly, you want to use a custom configuration for the retry time cycles.
In that case you have to add the Job Retry Plugin to the configuration of the process engine.
Example of how to do it programmatically:
Example of how to do it using Spring:
The plugin is automatically activated in case you are using the pre-packaged distribution.
We are currently working on improving the docs on Job Executor for the next release. Have a sneak preview here:
http://stage.docs.camunda.org/guides/user-guide/#job-executor
(stage.docs...=current, unreleased master)
Cheers,
Daniel Meyer
-----Ursprüngliche Nachricht-----
Von: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] Im Auftrag von Bernd Rücker (camunda)
Gesendet: Montag, 5. August 2013 08:14
An: john.rich...@gmail.com; camunda-...@googlegroups.com
Betreff: AW: How to execute parallel Multi-Instance Call Activity's
Hi John.
5 minutes is the default LOCK timeout for jobs. You have to reconfigure this (from my head: JobExecutor.maxLockTime) in order to have threads/tx longer than this timeout (which is by the way not always a good idea - keep in mind that you have other timeouts as well - e.g. Transactions).
Cheers
Bernd
Evangelist & Consultant
www.camunda.org/community/team.html
-----Ursprüngliche Nachricht-----