I’m new to workflow foundation. I’m trying to build a .NET 4 console application. This can be divided into a number of tasks. Here is the nature of tasks.
- Few tasks are independent of each other and can be run parallel.
- Few tasks spawn two or more new tasks.
- Few tasks are dependent on output of other tasks which are running parallel and can be started only when they finish or provide the needed input.
e.g.

Here
- Task 1, 2 and 3 are independent.
Thus can be run parallel. - Task 4 when done, spawns 5 and 6
- Task 7 can be started only when task
4 and 2 are done.
While I can write my own framework using system threads and some messaging to do above, I was wondering if I can leverage workflow foundation 4.
I went through few samples on workflow, but I’ve not able to figure out how to trigger a new activity when it’s parent activities running parallel are finished.
Also if you know of any other way to solve above problem, do let me know.
Normally you move those depended task below the Parralel activity so you know all dependencies are satisfied.
Update:
Start with a Sequence. Add a Parallel with Task 1 and 4 on one side and 3 on the other side. Below add another Parallel with 3 branches containing 5,6 and 7.
It isn’t exactly the same though if Task 2 takes longer than Task 1 + 4.
[Ankush]So what you are suggesting is like this
