How to set Parallel activity "CompletionCondition" true
-
2012年5月3日 上午 05:18
Hello all,
In visual stduio 2010 workflow i have a parallel actvity with two branches. My simple requirement is to programatically skip the exectuion of second branch if a particular condition is met in the first branch in parallel activity.
I have also seen this article below but i am unable to understand that how can i set programatically "CompletionCondition" to true in any activity inside parallel activity and then give permission to control to go beyond the parallel activity. Because until the second branch does not execute control does not transfer outside the parallel activities.
How can i achieve this???
Thanks in advance.
- 已編輯 Marreena 2012年5月3日 上午 05:59
所有回覆
-
2012年5月3日 下午 12:38
Are you developing your workflow for SharePoint 2010? If yes then you will need to stick with .net 3.5 framework for SharePoint 2010 and the Parallel.CompletionCondition property is in .net framework 4.0 and not in 3.5 (as far as I know).
The following article explains how to use this Property but again that is .net framework 4.0.
http://blogs.u2u.be/peter/post/2009/10/15/Workflow-4-parallel-and-compensation-activities.aspx
If you want to use something similar in 3.5 then I think the best bet is to use sequential activity and use If Else condition to verify the result of the previous activity and based on that decide if the activity should run or jump to next activity.
Amit
-
2012年5月4日 上午 04:10
Thanks Amit,
You are right iam using .Net framework 3.5. I didn't check in .Net framework 4. So can i convert my current workflow from 3.4 to 4.0 without any problem??? Or i have to create new one ???
And you said i should use ifelse activity. Actually the problem begins when i have two activities like "OnTaskChanged" and "OnWorkflowItemChanged" in the same workflow. Whenever i change the task "OnTaskChanged" activity works and debug, but "OnWorkflowItemChanged" not. So this works in parallel activity if i am correct. So i only have to use parallel activity this according to my logic.
Thanks.
-
2012年5月4日 下午 12:42
You have to use .net framework 3.5 to be able to deploy this workflow to SharePoint 2010.
I understand what you are saying but in other threads I have already pointed out that when you se OnTaskChanged and OnWorkflowItemChanged activity together you may run into issue where workflow is watching your OnTaskChanged activity and OnWorkflowItemChanged activity gets fired. I have pointed out couple of blog posts for that well. Did you try them?
I do not think that Parallel activity is going to help in scenario. It owuld have been helped if you had CompletionCondition property but it is not available for 3.5 framework.
Amit
- 已標示為解答 Marreena 2012年5月4日 下午 04:52

