We have a requirement to execute two tasks parallel and asynchronously, I designed a simple process with two service tasks to execute parallel(with parallel gateway) and assigned JavaDelegate services to execute. When i run the process from test case :
When activiti:async="false" parallel services are executing(sequentially).
If we make activiti:async="true" my parallel services are not executing at all.(also made activiti:exclusive="false")
Note: we enabled/Activated AsyncExecutor in engine configuration also.
Good to hear that you find it helpful and your issue got resolved.
But just a quick question that How do you make Parallel Gateway Async by using local Activiti framework? I couldn't find the attribute for making Parallel Gateway Async it in UI of actual activiti framework.
Really interesting that the old eclipse designer has both flags.
Certainly Exclusive will impact the behavior of the gateway by only allowing one parallel flow to execute in the instance at a time (i.e. if they share a parent execution). The main reason to do this is to stop potential database locking issues.
However I just checked the source for all of the gateways and the async flag is not even read (as far as I can tell).
However, what is likely happening is, the task prior to the gateway see's the gateway is labeled async and does not continue execution rather the thread is put onto the Job executor queue. It is picked up later (likely the next pass) and starts executing, however it now has a completely clean execution context (nothign carried over from earlier thread) so perhaps this is what is allowing the parallel flow to continue.
Would love to see a unit test on this to try to track the flow.