AnsweredAssumed Answered

Process instance execution happening sequentially

Question asked by pavlos on Nov 5, 2012
Latest reply on Nov 6, 2012 by pavlos
Hello,

I have a process definition containing a service task that takes a few seconds to run. For performance reasons, I would like to run several instances of this process in parallel. I start each process instance in a for loop:


        for (SomeEntity e : entities) {

            LOG.info("Processing: " + e.getId());
            Map<String, Object> processVariables = new HashMap<String, Object>();
            processVariables.put("entity", e);

            runtimeService.startProcessInstanceByKey(PROCESSKEY, processVariables);
   }

According to the user manual, each process instance should run in a seperate thread: "And jobs from other process instances are delegated to other threads and executed concurrently". However, I see them all running in the same thread. If I turn the long running service task's async attribute to true, the process instances do indeed execute in a parallel manner.

I am using activiti 5.10 embedded in my spring app with a pretty simple configuration. The jobExecutor is activated in its defaut configuration. Any hints what I am doing wrong?

Thank you,
Pavlos

Outcomes