AnsweredAssumed Answered

Activiti camel: problem with receive task within multi-instance subprocess

Question asked by kenrobrt on Apr 8, 2016
Latest reply on Apr 12, 2016 by jbarrez
Hi,

I'm using Activiti together with Camel. I have a multi-instance subprocess which contains a receive task. Basically it loops a list of persons which are sent email that they need to sign a form in a website. When person signs the form, receive task is signaled and the process goes forward. We then move on to send confirmation email to this person that he has successfully signed.

I noticed that if multiple signers sign at the same time (e.g. two signers), then receive tasks are signaled roughly at the same time. When we send confirmation email to those two signers, both emails are sent to the latter person who signed. I researched this a little bit and I think this happens because the camel body (which contains information about the signer, like signer name, email address etc.) of the first instance is copied to Activiti, then it is overwritten by the camel body of the second instance. Then when we move on from the receive task to do the email sending in Camel, the Activiti camelBody is copied to camel body and it contains information about the last signer in both instances.

Is my way of thinking correct and if so, does Activiti provide any ways to solve this?

Outcomes