views:

245

answers:

2

This might seem like a silly thing to say, the final branch in a parallel activity so I'll clarify. It's a parallel activity with three branches each containing a simple create task, on task changed and complete task. The branch containing the task that is last to complete seems to break. So every task works in it's own right, but the last one encounters a problem.

Say the user clicks the final tasks link to open the attached infopath form and submits that. Execution gets to the event handler for that onTaskChanged where a taskCompleted variable gets set to true which will exit the while loop. I've successfully hit a breakpoint on this line so I know that happens. However the final activity in that branch, the completeTask doesn't get hit.

When submit is clicked in the final form, the operation in progess screen says of for quite a while before returning to the workflow status page. The task that was opened and submitted says "Not Started".

I can disable any of the branches to leave only two, but the same problem happens with the last to be completed. Earlier on in the workflow I do essencially the same thing. I have another 3 branch parallel activity with each brach containing a task. This one works correctly which leads me to believe that it might be a problem with having two parallel activites in the same sequential workflow.

I've considered the possibility that it might be a correlation token problem. The token that every task branch uses is unique to that branch and it's owner activity name is est to that of the branch. It stands to reason that if the task complete variable is indeed getting set to true but the while loop isn't being exited, then there's a wire crossing with the variable somewhere. However I'd still have thought that the task status back on the workflow status page would at least say that the task is in progress.

This is a frustrating show stopper of a bug for me. Any thoughts or suggestions would be much appricated so I can investigate them.

A: 

Dan, did you ever figure this problem out? I am about to start a workflow that has a three branch parallel activity and just started looking at how folks have developed this. Cheers, Jake

Jake Jacobsen
I didn't manage to find out why it was doing this. It was quite some time ago and I don't remember the problem so well any-more. I just ended up having to modify the requirements to get around the problems. Additionally I wouldn't post your email on here if I were you. Not if you don't want to get spammed to death that is.
Dan Revell
By modify the requirements I mean not having more than three parallel tasks for that particular project. Strange that in more recent projects I haven't had such problems. It must have been a mix of my inexperience at the time and a particular detail with my situation that I couldn't figure out. I would suggest just trying a simple three branch parallel activity and seeing what happens yourself. You might not get the same problems that I did.
Dan Revell
A: 

Dan, this may be unfair to ask after so long, but how did you get the OnTaskChanged into the same parallel activity as the createTask? I get an error StateInitializationActivity cannot contain activities that implement 'System.Workflow.Activities.IEventActivity'.

I am assuming you are using a state machine workflow ...

Macrel
I believe I put the various task activities inside a sequence activity which I then placed inside the parallel branch.
Dan Revell