Asynchronous parallel execution is not working.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member II

Asynchronous parallel execution is not working.

Jump to solution

Hi All,

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.

Please help us to solve this problem.

Thanks,

Keshav

1 Solution

Accepted Solutions
Highlighted
Active Member II

Re: Asynchronous parallel execution is not working.

Jump to solution

Thanks Ami Dave for quick reply.

My problem solved, Issue was with parallel gateway.. I made services async but forgot to make gateway async.

View solution in original post

6 Replies
Highlighted
Active Member

Re: Asynchronous parallel execution is not working.

Jump to solution

Hi Keshav,

Checkout:  
I have reported the same issue, probably you can go through the replies to it.

Thanks,
Ami Dave

Highlighted
Active Member II

Re: Asynchronous parallel execution is not working.

Jump to solution

Thanks Ami Dave for quick reply.

My problem solved, Issue was with parallel gateway.. I made services async but forgot to make gateway async.

View solution in original post

Highlighted
Active Member

Re: Asynchronous parallel execution is not working.

Jump to solution

Hi Keshav,

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.

Thanks,

Ami Dave

Highlighted
Active Member II

Re: Asynchronous parallel execution is not working.

Jump to solution

Hi Ami Dave,

I am using Activiti Designer plugin with JBoss, which is providing check boxes for Asynchronous and Exclusive. see below:

Highlighted
Intermediate

Re: Asynchronous parallel execution is not working.

Jump to solution

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.

Greg

Highlighted
Active Member

Re: Asynchronous parallel execution is not working.

Jump to solution

Oh Hi Keshav,

This is a nice plugin indeed, need to try once. I generally use my local Activiti explorer externally, so that it doesn't increase load of Eclipse. And in there I didn't find these 2 attributes.

Ami