cancel
Showing results for 
Search instead for 
Did you mean: 

Question about Activiti 5.9 asynchronous mode

rainman
Champ in-the-making
Champ in-the-making
Hello, everyone
I configured a process definition with 4 serviceTasks, each of which is under "activiti:async" mode and would sleep for 5 seconds during execution.
I started 3 process instances concurrently. Ideally, the process engine should create one separate JavaDelegate object for each of the process instance, but I discovered that, sometimes, different process instances are using a same JavaDelegate object for execution.

Is this a bug?

I'm waiting on line, thank you very much:-)
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
Quoting the user guide (http://activiti.org/userguide/index.html#bpmnJavaServiceTaskXML😞

Note: there will be only one instance of that Java class created for the serviceTask it is defined on. All process-instances share the same class instance that will be used to call execute(DelegateExecution). This means that the class must not use any member variables and must be thread-safe, since it can be executed simultaneously from different threads. This also influences the way Field injection is handled.