cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple receive tasks waiting for signal at the same time

kenrobrt
Champ in-the-making
Champ in-the-making
Hi,

I use Activiti + Camel in my program. Simply put the program is a "form signing application" where I have a form that needs to be signed by a group of people. When everyone has signed the form, the signed form is archived and we're done.

So in my BPMN diagram, I fetch the contact email of one person, then use parallel gateway which goes to fetch next person's contact details and which creates a subprocess. Subprocess has a receive task which waits for a message that person has signed the form. When person signs, subprocess is killed and we mark that person has signed the form.

So if there's person A, B and C, then 3 subprocess have been created and 3 receive tasks wait for a signal that form has been signed. So when one person signs the form, I call the receive task from Camel like this:

<to uri="activiti:SigningProcess:WaitForNotificationForSignatureTask"/>


Problem is that I get the following exception:
ActivitiException: Query return 3 results instead of max 1.


So I guess it does that because there's 3 receive tasks waiting for a message and when I call the task, Activiti gets confused which 3 of them I'm calling. My program logic doesn't really care which one of them I'm calling so I'd like to arbitrarily call one of them and move on, is this possible?
4 REPLIES 4

kenrobrt
Champ in-the-making
Champ in-the-making
Forgot to mention that contact emails are needed for sending a notification to the person that he has a form to sign.

3 receive tasks wait for a signal
So I guess it does that because there's 3 receive tasks waiting for a message
Sorry, I meant 3 instances of this one specific receive task, not 3 different tasks.

trademak
Star Contributor
Star Contributor
Hi,

In the current Camel integration implementation we send the process instance id to the exchange and that's also used to signal a task in the process again when Camel returns. So currently there can only be one active execution for a specific activityId. I fully understand your use case and I would be more than happy to get this working by also adding an execution id to the Camel exchange, so that can be used to signal the correct receive task instance. Could you create a JIRA issue, then I'll look into it rightaway.

Best regards,

kenrobrt
Champ in-the-making
Champ in-the-making
Hi,

I created the issue: https://activiti.atlassian.net/browse/ACT-4033

Thanks a lot! Are you planning to make a new release sometime near future or do you have any alternative solutions in mind for my case? I initially made a sequential version where I wait for one person to sign before I send notification about signing to the next person.

trademak
Star Contributor
Star Contributor
Hi,

Thanks for the JIRA issue. Yes we are planning to release 5.18 this month. I'll look into this issue today or tomorrow and see if I can solve it.

Best regards,