Multiple receive tasks waiting for signal at the same time

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2015 06:04 AM
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:
Problem is that I get the following exception:
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?
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?
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2015 06:26 AM
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 messageSorry, I meant 3 instances of this one specific receive task, not 3 different tasks.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2015 03:04 AM
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,
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,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2015 03:50 AM
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.
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.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2015 04:59 AM
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,
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,
