none
CompositeActivity cannot transition to 'Closed' status when there are active child context still exist for child activity. RRS feed

  • Question

  • Hi,

    I'm trying to send email to the task owner when a workflow task is pending, I have 2 activities inside "OnTaskPending" activity, the first activity (custom activity) is to build email related items (Subject, Body, To and CC) and the second activity (SendEmail activity) is to send the email.

    In my scenario the task is assigned to two resources, so the activities inside "OnTaskPending" activity will be executed twice. While the first one is executing and before it get completed, the second one will start executing and because the first one is not finished yet, I get the following error:

    "CompositeActivity cannot transition to 'Closed' status when there are active child context still exist for child activity."

    If the task was assigned to one resource, it will work fine.

    Based on my research and understanding, I should write a code to execute the activity in another context if the same activity is executing in the same context. 

    I don't know how to do that and I don't know if this is the right thing to do.

    Tuesday, November 1, 2011 9:39 AM