<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Parallelism in Windows Workflow Foundation (WF)</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx</link><description>QUESTION: Does a ParallelActivity start one thread for each branch? How many threads will it use for processing? 
 ANSWER: The short answers are "no" and "1". If you've heard it before, then these answers make sense. If not, then read on for an explanation</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Understanding ParallelActivity in Windows Workflow</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#4879050</link><pubDate>Wed, 12 Sep 2007 15:13:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4879050</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;You might think that the ParallelActivity in Windows Workflow Foundation is misnamed. At the very least&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4879050" width="1" height="1"&gt;</description></item><item><title>Understanding ParallelActivity in Windows Workflow</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#4878972</link><pubDate>Wed, 12 Sep 2007 15:05:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4878972</guid><dc:creator>Kirk Allen Evans' Blog</dc:creator><description>&lt;p&gt;You might think that the ParallelActivity in Windows Workflow Foundation is misnamed. At the very least,&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4878972" width="1" height="1"&gt;</description></item><item><title>re: Parallelism in Windows Workflow Foundation (WF)</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#4309802</link><pubDate>Thu, 09 Aug 2007 15:09:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4309802</guid><dc:creator>chakshushah</dc:creator><description>&lt;p&gt;Is it possible to create this bug-tracking workflow - Sequential workflow on the fly? My workflow designer is hosted on Web.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4309802" width="1" height="1"&gt;</description></item><item><title>Zen and the Art of Information Management &amp;raquo; SharePoint Workflow: When Parallel is Serial</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#4123929</link><pubDate>Mon, 30 Jul 2007 04:19:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4123929</guid><dc:creator>Zen and the Art of Information Management » SharePoint Workflow: When Parallel is Serial</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.kcdholdings.com/blog/?p=75"&gt;http://www.kcdholdings.com/blog/?p=75&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4123929" width="1" height="1"&gt;</description></item><item><title>Use Workflow to Invoke Web Services in Parallel</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#3670992</link><pubDate>Tue, 03 Jul 2007 16:50:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3670992</guid><dc:creator>Kirk Allen Evans' Blog</dc:creator><description>&lt;p&gt;.style1 { color: black; } The very first time I saw Windows Workflow Foundation (WF), I slapped together&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3670992" width="1" height="1"&gt;</description></item><item><title>Rientranza delle chiamate in WF</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#1614186</link><pubDate>Wed, 07 Feb 2007 01:21:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1614186</guid><dc:creator>Paolo Pialorsi</dc:creator><description>&lt;p&gt;In questi giorni, a seguito di una consulenza su WF, ho potutoverificare in dettaglio alcuni aspetti&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1614186" width="1" height="1"&gt;</description></item><item><title>Parallelism in Windows Workflow Foundation</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#658132</link><pubDate>Thu, 06 Jul 2006 21:10:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:658132</guid><dc:creator>Living in a World of Connected Systems</dc:creator><description>&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=658132" width="1" height="1"&gt;</description></item><item><title>re: Parallelism in Windows Workflow Foundation (WF)</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#583850</link><pubDate>Wed, 26 Apr 2006 09:24:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:583850</guid><dc:creator>fanse</dc:creator><description>ntalbert,Thanks for your so detailed answer,I have thought for a long time,but I never noticed Replcator activity.Now I will model this workflow use state machine workflow,about sequential workflow,because the rejected document will be re edited or re submitted,I fell a little difficult modelling it using Sequential workflow.Thanks again in my heart.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=583850" width="1" height="1"&gt;</description></item><item><title>re: Parallelism in Windows Workflow Foundation (WF)</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#583468</link><pubDate>Tue, 25 Apr 2006 22:45:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:583468</guid><dc:creator>ntalbert</dc:creator><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Fanse, you have several options for design here, so let me enumerate a couple and discuss the relative pros and cons. &lt;BR&gt;&lt;BR&gt;First, let me clarify the scenario which these solutions will target. &amp;nbsp;This way the comment will still have value (hopefully) even if my details do not match completely with yours. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;STRONG&gt;Scenario:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;&lt;FONT face=Tahoma size=2&gt;There is a single workflow instance which manages the approval of a document. &amp;nbsp;When the document is submitted, the workflow is started and the document is in the Submitted state. &amp;nbsp;An unknown number of people will be asked to review the document (based on roles, arbitrary rules, some database - this is not important). &amp;nbsp;A Rejected or Delayed answer from any one person will put the document in the Rejected state and end the workflow. &amp;nbsp;If all reviewers return Approved then the document will be in the Approved state and the workflow will end. &amp;nbsp;(These conditions which cause the workflow to end will be discussed later.) &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;State Machine Solution: &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;&lt;FONT face=Tahoma size=2&gt;This solution models the workflow based on the states of the document. &amp;nbsp;As such, there will be four states - Submitted, Approved, Rejected, and Completed. &amp;nbsp;The fourth state is a trigger for the workflow to complete ... we will revisit this later. &lt;BR&gt;&lt;BR&gt;The Submitted state will have a state initialization handler which calculates the list of approvers and then notifies them that they must approve the document. &amp;nbsp;How do we notify them? &amp;nbsp;Well, maybe you want to model this as a SendEmailActivity or maybe it is a call to a local service through a CallExternalMethodActivity or possibly it is a custom activity which calls some custom runtime service to add entries to a database. &amp;nbsp;The important thing is this is an implementation detail which we don't need to delve into right now. &lt;BR&gt;&lt;BR&gt;Submitted: StateInitialization &lt;BR&gt;&amp;nbsp;&amp;lt;Code Name="CreateApproversList" /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;lt;Replicator Name="ForEachApprover" InitialChildData=ActivityBind("createdApproversList")&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;lt;CreateTask Name="NotifyApprover"/&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;lt;/Replicator&amp;gt; &lt;BR&gt;&lt;BR&gt;The Submitted state will also have an event called ApproverResponseReceived. &amp;nbsp;Once again, the nature of this event is not important - it might be a HandleExternalEventActivity or it might be a custom activity based on queues. &amp;nbsp;We'll assume that the data delivered by the event is the name of the approval and the response (Approved, Rejected, Delayed). &amp;nbsp;When this event is raised we will check the response and if it is Rejected or Delayed we will move the state machine to the Rejected state. &amp;nbsp;If it is Approved then we will remove the approver's name from our list. &amp;nbsp;If our list is now empty then we move to the Approved state otherwise we stay in the current state. &lt;BR&gt;&lt;BR&gt;Submitted: ApproverResponseReceived &lt;BR&gt;&amp;nbsp;&amp;lt;ReceiveResponse/&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;lt;IfElse&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;lt;Branch1 (Response==Rejected || Response==Delayed)&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;SetState State="Rejected"/&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/Branch1&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;lt;Branch2&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Code Name="RemoveApproverFromList"/&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;IfElse&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Branch1 (createdApproversList.Count == 0)&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;SetState State="Approved"/&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Branch1&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/IfElse&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/Branch2&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;lt;/IfElse&amp;gt; &lt;BR&gt;&lt;BR&gt;The Approved and Rejected states both notify the host of the result (or set an appropriate outbound parameter) and then move to the Completed state which causes the workflow to exit. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;EM&gt;Benefits: &lt;/EM&gt;&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;This solution has the benefit of mapping directly to how you thought of your problem. &amp;nbsp;The workflow will be in a state corresponding to the document state. &amp;nbsp;Additionally, if you want to allow resubmission of the document from the Rejected state then it would be a simple task to add a new event handler to Rejected which transitions the workflow back to the Submitted state. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;EM&gt;Drawbacks:&lt;/EM&gt;&lt;/STRONG&gt; &lt;BR&gt;&lt;BR&gt;This solution does not, however, have nice handling of the approvers. &amp;nbsp;Imagine that we wanted to do something more complex with the approvers such as allow them to delegate the task, remove themselves from the list, or have specific flow based on their inputs. &amp;nbsp;It could all be modeled with event handlers in the state machine which all pass the approver's name as a parameter but this is not as nice as the Sequential Solution which we will show below. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Sequential Solution: &lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;We'll start in the same place with a CodeActivity which generates the list of approvers. &amp;nbsp;This will then be fed to a Replicator which, this time, contains a more complex child which will run instances in parallel. &lt;BR&gt;&lt;BR&gt;The Replicator's child will be responsible for handling the entire interaction with one approver. &amp;nbsp;In our case this is simply to notify the approver of the waiting task and then wait for the approver's response. &amp;nbsp;We will make use of the ExternalDataExchangeService correlation features to map an inbound event to the correct HandleExternalEventActivity. &amp;nbsp;This is necessary now that we are running multiple instances of the same event in parallel. &lt;BR&gt;&lt;BR&gt;The skeleton workflow: &lt;BR&gt;&lt;BR&gt;&amp;lt;Sequence&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;lt;Code Name="CreateApproversList" /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;lt;Replicator ExecutionType=Parallel InitialChildData=ActivityBind("createdApproversList")&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;lt;Sequence&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;CallExternalMethodActivity InterfaceType="IApproverTask" MethodName="CreateApproverTask" CorrelationToken="token1"/&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;HandleExternalEventActivity InterfaceType="IApproverTask" EventName="TaskCompleted" CorrelationToken="token1"/&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/Sequence&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;lt;/Replicator&amp;gt; &lt;BR&gt;&amp;lt;/Sequence&amp;gt; &lt;BR&gt;&lt;BR&gt;The IApproverTask interface might look something like: &lt;BR&gt;&lt;BR&gt;[DataExchangeService] &lt;BR&gt;[CorrelationParameter("approverName")] &lt;BR&gt;public interface IApproverTask &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;[CorrelationInitializer] &lt;BR&gt;&amp;nbsp;void CreateApproverTask(string approverName, TaskData data); &lt;BR&gt;&amp;nbsp;[CorrelationAlias("approverName", "e.ApproverName")] &lt;BR&gt;&amp;nbsp;event EventHandler&amp;lt;TaskCompletedEventArgs&amp;gt; TaskCompleted; &lt;BR&gt;} &lt;BR&gt;&lt;BR&gt;I'm going to assume that the ExternalDataExchangeService and its related attributes, activities, and correlation features are understood. &amp;nbsp;If this is not the case you can find more data on these in the help files and samples. &lt;BR&gt;&lt;BR&gt;Last, but not least, let's mention the Replicator's various events and its UntilCondition. &amp;nbsp;We'll specify a ChildInitialized handler which will be responsible for setting the ApproverName on the CallExternalMethodActivity. &amp;nbsp;We'll also specify a ChildCompleted handler which, in the case of a rejection or delay, will set the workflow's output variable to be Rejected. &amp;nbsp;Finally, the UntilCondition will be set to return replicatorInstance.AllChildrenComplete || result == Rejected. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;EM&gt;Benefits: &lt;/EM&gt;&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;If the interaction with an approver is made more complex it will be a simple matter to model the interaction in the replicator's child sequence. &amp;nbsp;Note that you can now think of the problem as the interaction with a single approver instead of as a generic interaction with many approvers. &amp;nbsp;From a flow point of view, this is much easier to follow the logic: Create an approvers list, for each approver we notify of the task and wait for completion, and we short circuit the logic and complete if a Rejected/Delayed response is returned. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;EM&gt;Drawbacks: &lt;BR&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR&gt;Unless you want to implement your own correlation your hand is forced in the choice of communications: ExternalDataExchangeService is the way to go here. &amp;nbsp;And while modeling the interaction is simpler, providing the "loop" will be a little less natural - we'd have a while loop which checked the result property for Approved. &amp;nbsp;Finally, while we are modeling flow in a more readable fashion we are no longer modeling the state of our document like we were with the State Machine. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Conclusion: &lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;These are just two solutions and there are likely to be countless others. &amp;nbsp;These have also been somewhat simplified for the purposes of illustration - we've gone into detail of the workflows but haven't gone into the details of the system existing just outside the workflow. &amp;nbsp;Hopefully this will get you started with some ways to approach the problem. &amp;nbsp;If you have any questions, check the docs and samples first and then feel free to ask.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=583468" width="1" height="1"&gt;</description></item><item><title>re: Parallelism in Windows Workflow Foundation (WF)</title><link>http://blogs.msdn.com/b/advancedworkflow/archive/2006/02/23/538160.aspx#582873</link><pubDate>Tue, 25 Apr 2006 11:44:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:582873</guid><dc:creator>fanse</dc:creator><description>I am working with a document approval workflow,when a document is created,the owner will choose several departments to get aprrove.only after all these approvers have &amp;nbsp;done the approve action,the document 's &amp;nbsp;state can be changed to approved,if one of the approvers reject it,the document's state will be changed to rejected.If one of the approvers delay the action,the document's state will be changed to rejected too.How can i desin this workflow use wwf?&lt;br&gt;I have thought for a long time,but have no answer,can you help me ?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=582873" width="1" height="1"&gt;</description></item></channel></rss>