<?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>Matt W's Windows Workflow Place : vNext</title><link>http://blogs.msdn.com/mwinkle/archive/tags/vNext/default.aspx</link><description>Tags: vNext</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Introducing the WF4 Designer</title><link>http://blogs.msdn.com/mwinkle/archive/2009/05/20/introducing-the-wf4-designer.aspx</link><pubDate>Wed, 20 May 2009 23:27:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9632833</guid><dc:creator>mwinkle</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/9632833.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=9632833</wfw:commentRss><description>&lt;p&gt;&lt;em&gt;// standard disclaimer applies, this is based on the released Beta 1 bits, things are subject to change, if you are reading this in 2012, things may be, look, smell, work differently.&amp;#160; That said, if it’s 2012 and you’re reading this, drop me a line and let me know how you found this!&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;As you might have heard, &lt;a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx"&gt;Beta1 of VS is out the door, and available to the public sometime today&lt;/a&gt;.&amp;#160; As you may know we’ve done a bunch of work for WF4, and I wanted to give a quick, high level overview of the designer.&amp;#160; &lt;a href="http://blogs.msdn.com/endpoint/archive/2009/05/20/vs-2010-and-net-framework-4-0-beta1-available-for-download.aspx"&gt;Here’s a good overview&lt;/a&gt; for the new WF bits all up.&lt;/p&gt;  &lt;p&gt;First, let’s start with your existing WF projects.&amp;#160; What happens if I want to create a 3.5 workflow?&amp;#160; We’re still shipping that designer, in fact, let’s start there on our tour.&amp;#160; This shows of a feature of VS that’s&amp;#160; pretty cool, multitargeting.&amp;#160; &lt;/p&gt;  &lt;p&gt;Click New Project&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb.png" width="596" height="429" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Notice the “Framework Version” dropdown in the upper right hand corner. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_28.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_13.png" width="409" height="186" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This tells VS which version of the framework you would like the project you are creating to target.&amp;#160; This means you can still work on your existing projects in VS 2010 without upgrading your app to the new framework.&amp;#160; Let’s pick something that’s not 4.0, namely 3.5.&amp;#160; You’ll note that the templates may have updated a bit, select Workflow from the left hand tree view and see what shows up.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_1.png" width="604" height="446" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There isn’t anything magical about what happens next, you will now see the 3.5 designer inside of VS2010.&amp;#160; You’re able to build, create, edit and update your existing WF applications.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_2.png" width="424" height="523" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Let’s move on and switch over to a 4.0 workflow.&lt;/p&gt;  &lt;p&gt;Create a new project and select 4.0&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_3.png" width="529" height="389" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Create a new WF Sequential Console application and name it “SampleProject”.&amp;#160; Click Ok.&lt;/p&gt;  &lt;p&gt;We’ll do a little bit of work here, but you will shortly see the WF 4.0 designer.&amp;#160; It looks a little different from the 3.x days, we’ve taken this time to update the designer pretty substantially.&amp;#160; We’ve built it on top of WPF, which opens up the doors for us to do a lot of interesting things.&amp;#160; If you were at PDC and saw any Quadrant demos, you might think that these look similar. We haven’t locked on the final look and feel yet, so expect to see some additional changes there, but submit your feedback early and often, we want to know what you think.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_10.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_4.png" width="464" height="575" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Let’s drop some activities into our sequence and see what’s there to be seen.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_12.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_5.png" width="143" height="561" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We’ve categorized the toolbox into functional groupings for the key activities.&amp;#160; We heard a lot of feedback that it was tough to know what to use when, so we wanted to provide a little more help with some richer default categories.&amp;#160; Add an Assign activity, a WriteLine activity and a Delay activity to the canvas by clicking and dragging over the to the sequence designer.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_14.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_6.png" width="223" height="305" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You’ll note that we’ve now got some icons on each activity indicating something is not correct.&amp;#160; This is a result of the validation executing and returning details about what is wrong.&amp;#160; Think of these as the little red squiggles that show up when you spell something wrong.&amp;#160; You can hover over the icon to see what’s wrong&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_16.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_7.png" width="467" height="110" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can also see that errors will bubble up to their container, so hovering over sequence will tell you that there is a problem with the child activities.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_18.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_8.png" width="445" height="290" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;What if I have a big workflow, and what if I want to see a more detailed listing of errors?&amp;#160; Open up the Error View and you will see the validation results are also displayed here.&amp;#160; You’ll note there is some minor formatting weirdness.&amp;#160; This is a bug that we fixed but not in time for the Beta1 release.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_20.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_9.png" width="650" height="178" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now, let’s actually wire up some data to this workflow.&amp;#160; WF4 has done a lot of work to be much more crisp about the way we think about data within the execution environment of a workflow. We divide the world into two types of data, Arguments, and Variables.&amp;#160; If you mentally map these to the way you write a method in code (parameters, and state internal to the method), you are one the right track.&amp;#160; Arguments determine the shape of an activity, what goes in, what goes out.&amp;#160; Variables allocate storage within the context of an activities execution.&amp;#160; The neat thing about variables, once the containing activity is done, we can get rid of the variables, as our workflow no longer needs them (note, we pass the important data in and out through the arguments).&amp;#160; To do this, we have two special designers on the canvas that contain information about the arguments and variables in your workflow &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_42.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_20.png" width="631" height="245" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;First, let’s click on the Argument designer and pass in some data.&amp;#160; &lt;/p&gt;  &lt;p&gt;Arguments consist of a few important elements&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Name &lt;/li&gt;    &lt;li&gt;Type &lt;/li&gt;    &lt;li&gt;Direction &lt;/li&gt;    &lt;li&gt;Default Value (Optional) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_22.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_10.png" width="436" height="298" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Most of these are self explanatory, with the one exception being the Direction.&amp;#160; You’ll note that this has In, Out and Property.&amp;#160; Now, when you are editing the arguments, you are actually editing the properties of the underlying type you are creating (I’ll explain more about this in a future post).&amp;#160; A more appropriate name might be “Property Editor” but the vast majority of what you’ll be creating with it is arguments.&amp;#160; Anyway, If you select In or Out, this basically wraps the type T in an InArgument, so it becomes a property of type InArgument&amp;lt;T&amp;gt;.&amp;#160; We just provide a bit of a shorthand so you don’t always have to pick InArgument as the type.&amp;#160; The default value takes an expression, but in this case, we won’t be using it.&lt;/p&gt;  &lt;p&gt;Let’s go ahead and add an argument of type TimeSpan named DelayTime.&amp;#160; You’ll need to select browse for types and then search for the TimeSpan&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_24.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_11.png" width="484" height="557" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Variables are similar, but slightly different, variables have a few important elements:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Name &lt;/li&gt;    &lt;li&gt;Type &lt;/li&gt;    &lt;li&gt;Scope &lt;/li&gt;    &lt;li&gt;Default Value (Optional) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Remember earlier, I mentioned that variable is part of an activity, this is what Scope refers to.&amp;#160; Variables will only show up to be the scope of the selected activity, so if you don’t see any, make sure to select the Sequence, and then you will be able to add a variable.&amp;#160; Let’s add new variable, named StringToPrint, of type String.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_26.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_12.png" width="431" height="297" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now let’s do something with these in the workflow.&amp;#160; One thing I’m particularly happy with that we’ve done on the designer side of things is to enable people to build activity designers more easily.&amp;#160; There are lots of times where you have activities that have just a few key properties that need to be set, and you’d like to be able to see that “at a glance”&amp;#160; The assign designer is like that.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_30.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_14.png" width="267" height="102" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now, let’s dig into expressions.&amp;#160; One big piece of feedback from 3.0 was that people really wanted richer binding experiences.&amp;#160; You see this as well with the WPF data binding .&amp;#160; We’ve taken it to the next level, and allow any expression to be expressed as a set of activities.&amp;#160; What this means is that we do have to “compile” textual expressions into a tree of activities, and this is one of the reasons we use VB to build expressions.&amp;#160; In the fullness of time, other languages will come on board. But how to use it, let’s see.&amp;#160; Click on the “To” text box on the Assign activity.&amp;#160; You will see a brief change of the text box, and then you will be in a VB Expression Editor, or what we’ve come to refer to as “The Expression Text Box” or ETB.&amp;#160; Start typing S, and already you will see intellisense begin to scope down the choices.&amp;#160; This will pick up all of the variables and arguments in scope.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_32.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_15.png" width="330" height="314" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;On the right side, we won’t use any of the passed in arguments, we’ll show off a richer expression.&amp;#160;&amp;#160; Now, the space on the right side of the designer is kind of tight for something lengthy, so go to the property grid and click on the “…” button for the Value property &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_34.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_16.png" width="580" height="404" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;String&lt;/span&gt;.Format(&lt;span class="str"&gt;&amp;quot;Someone wants to wait {0} seconds&amp;quot;&lt;/span&gt;, TimeToWait.TotalSeconds)&lt;/pre&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;This just touches the surface of what is possible with expressions in WF4, we can really get&amp;#160; much richer expressions (3.x expressions are similar to WPF data binding, they are really an “object” + “target” structure).&lt;/p&gt;

&lt;p&gt;Not everything makes it to the canvas of the designer surface, and for that, we have the property grid.&amp;#160; If you’ve used the WPF designer in VS2008, this should look pretty familiar to you.&amp;#160; Select the delay activity, and use the property grid to set the duration property to the InArgument you created above.&amp;#160; This experience is similar, with the ETB embedded into the property grid for arguments. &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Finally, repeat with the WriteLine and bind to the StringToPrint variable.&lt;/p&gt;

&lt;h1&gt;Navigating the Workflow&lt;/h1&gt;

&lt;p&gt;There are two different things that we have to help navigating the workflow, our breadcrumb bar at the top and the overview map (which appears as the “Mini Map” in the beta).&amp;#160; Let’s look at the overview map.&amp;#160; This gives you a view of the entire workflow and the ability to quickly scrub and scroll across it.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_36.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_17.png" width="337" height="531" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Finally, across the top we display our breadcrumbs which are useful when you have a highly nested workflow.&amp;#160; Double click on one of the activities, and you should see the designer “drill into” that activity.&amp;#160; Now notice the breadcrumb bar, it displays where you have been, and by clicking you can navigate back up the hierarchy.&amp;#160; In beta1, we have a pretty aggressive breadcrumb behavior, and so you see “collapsed in place” as the default for many of our designers.&amp;#160; We’re probably going to relax that a bit in upcoming milestones to reduce clicking and provide a better overview of the workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_40.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_19.png" width="402" height="530" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Finally, there may be times where we don’t want to have a designer view, but would rather see the XAML.&amp;#160; To get there, just right click on the file and ask to “View Code”&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_38.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_18.png" width="236" height="362" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This will currently ask you if you are sure that you want to close the designer, and you will then see the XAML displayed in the XML editor.&amp;#160; For the workflow we just created, this is what it looks like:&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:Activity&lt;/span&gt; &lt;span class="attr"&gt;mc:Ignorable&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;&amp;quot;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;     &lt;span class="attr"&gt;x:Class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;WorkflowConsoleApplication1.Sequence1&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;     &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/netfx/2009/xaml/activities/design&amp;quot;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;     &lt;span class="attr"&gt;xmlns:__Sequence1&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;clr-namespace:WorkflowConsoleApplication1;&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;     &lt;span class="attr"&gt;xmlns:mc&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;     &lt;span class="attr"&gt;xmlns:p&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/netfx/2009/xaml/activities&amp;quot;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;     &lt;span class="attr"&gt;xmlns:s&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;clr-namespace:System;assembly=mscorlib&amp;quot;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;     &lt;span class="attr"&gt;xmlns:sad&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;clr-namespace:System.Activities.Debugger;assembly=System.Activities&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;     &lt;span class="attr"&gt;xmlns:x&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;x:Members&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;x:Property&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;TimeToWait&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;p:InArgument(s:TimeSpan)&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;x:Members&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;__Sequence1:Sequence1.TimeToWait&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:InArgument&lt;/span&gt; &lt;span class="attr"&gt;x:TypeArguments&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;s:TimeSpan&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;[TimeSpan.FromSeconds(10)]&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:InArgument&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;__Sequence1:Sequence1.TimeToWait&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:Sequence&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:Sequence.Variables&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:Variable&lt;/span&gt; &lt;span class="attr"&gt;x:TypeArguments&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;x:String&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;StringToPrint&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:Sequence.Variables&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:Assign&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:Assign.To&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:OutArgument&lt;/span&gt; &lt;span class="attr"&gt;x:TypeArguments&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;x:String&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;            [StringToPrint]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:OutArgument&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:Assign.To&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:Assign.Value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:InArgument&lt;/span&gt; &lt;span class="attr"&gt;x:TypeArguments&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;x:String&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;                  [String.Format(&amp;quot;Someone wants to wait {0} seconds&amp;quot;, TimeToWait.TotalSeconds)]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;         &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:InArgument&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:Assign.Value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:Assign&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:Delay&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;[TimeToWait]&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:Delay&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p:WriteLine&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;[StringToPrint]&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:WriteLine&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:Sequence&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p:Activity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h1&gt;Executing the Workflow&lt;/h1&gt;

&lt;p&gt;Inside the project you will see the Program.cs to execute the workflow, let’s take a look at that. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; WorkflowConsoleApplication1&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Threading;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Activities;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Activities.Statements;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;class&lt;/span&gt; Program&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;            AutoResetEvent syncEvent = &lt;span class="kwrd"&gt;new&lt;/span&gt; AutoResetEvent(&lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;            WorkflowInstance myInstance =&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                &lt;span class="kwrd"&gt;new&lt;/span&gt; WorkflowInstance(&lt;span class="kwrd"&gt;new&lt;/span&gt; Sequence1(),&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;, &lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;                    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;                        {&lt;span class="str"&gt;&amp;quot;TimeToWait&amp;quot;&lt;/span&gt;, TimeSpan.FromSeconds(3.5) }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;                    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;                    );&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;            myInstance.OnCompleted = &lt;span class="kwrd"&gt;delegate&lt;/span&gt;(WorkflowCompletedEventArgs e) { syncEvent.Set(); };&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;            myInstance.OnUnhandledException = &lt;span class="kwrd"&gt;delegate&lt;/span&gt;(WorkflowUnhandledExceptionEventArgs e)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;                Console.WriteLine(e.UnhandledException.ToString());&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; UnhandledExceptionAction.Terminate;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;            };&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;            myInstance.OnAborted = &lt;span class="kwrd"&gt;delegate&lt;/span&gt;(WorkflowAbortedEventArgs e)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;                Console.WriteLine(e.Reason);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;                syncEvent.Set();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;            };&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;            myInstance.Run();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;            syncEvent.WaitOne();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Press &amp;lt;Enter&amp;gt; to exit&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;            Console.ReadLine();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;This is the standard program.cs template with two modifications.&amp;#160; The first is passing data into the workflow, indicated by the dictionary we create to pass into the WorkflowInstance.&amp;#160; This should look familiar if you have used WF in the past. &lt;/p&gt;

&lt;pre class="csharpcode"&gt; WorkflowInstance myInstance =
                &lt;span class="kwrd"&gt;new&lt;/span&gt; WorkflowInstance(&lt;span class="kwrd"&gt;new&lt;/span&gt; Sequence1(),
                    &lt;span class="kwrd"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;, &lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;
                    {
                        {&lt;span class="str"&gt;&amp;quot;TimeToWait&amp;quot;&lt;/span&gt;, TimeSpan.FromSeconds(3.5) }
                    }
                 );&lt;/pre&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The second is a break at the end to keep our console window open (lines 41 and 42).&amp;#160; Hitting F5 from our project results in the following output (as expected).&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_44.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/IntroducingtheWF4Designer_12E40/image_thumb_21.png" width="550" height="381" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This concludes our brief tour through the new WF designer.&amp;#160; I’ll be talking a lot more in upcoming days about some of the more programmatic aspects of it and how it’s put together. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9632833" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf/default.aspx">wf</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/vNext/default.aspx">vNext</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/vs10/default.aspx">vs10</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf4/default.aspx">wf4</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/beta/default.aspx">beta</category></item><item><title>10-4 Good Buddy, First Look at WF 4</title><link>http://blogs.msdn.com/mwinkle/archive/2009/04/16/10-4-good-buddy-first-look-at-wf-4.aspx</link><pubDate>Thu, 16 Apr 2009 20:30:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9553216</guid><dc:creator>mwinkle</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/9553216.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=9553216</wfw:commentRss><description>&lt;p&gt;Our WF evangelist, &lt;a href="http://blogs.msdn.com/rjacobs/" target="_blank"&gt;Ron Jacobs&lt;/a&gt;, just posted a &lt;a href="http://channel9.msdn.com/shows/10-4/10-4-Episode-16-Windows-Workflow-4/" target="_blank"&gt;10-4 screencast&lt;/a&gt; that walks through WF4 as it's looking in VS 2010.&amp;#160; This is a good first look at our bits since PDC (we've changed things a little bit).&amp;#160; I really like that he takes it from a unit testing perspective.&amp;#160; There are certainly things that have been added (like WorkflowInvoker.Invoke) which will make testing activities a lot easier than the 3.0 days.&lt;/p&gt;  &lt;p&gt;Check it out, let me know if you've got feedback.&amp;#160; &lt;/p&gt;   &lt;p&gt; &lt;object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="320" height="240"&gt; &lt;param name="source" value="http://channel9.msdn.com/App_Themes/default/VideoPlayer2009_03_17.xap" /&gt; &lt;param name="initParams" value="m=http://mschnlnine.vo.llnwd.net/d1/ch9/0/2/6/5/6/4/104Episode16Workflow_2MB_ch9.wmv,autostart=false,autohide=true,showembed=true, thumbnail=http://mschnlnine.vo.llnwd.net/d1/ch9/0/2/6/5/6/4/104Episode16Workflow_large_ch9.png, postid=465620" /&gt; &lt;param name="background" value="#00FFFFFF" /&gt; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"&gt; &lt;img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none" /&gt; &lt;/a&gt; &lt;/object&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9553216" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf/default.aspx">wf</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/screencasts/default.aspx">screencasts</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/vNext/default.aspx">vNext</category></item><item><title>WF 4.0 -- Designer Type Visibility</title><link>http://blogs.msdn.com/mwinkle/archive/2009/02/12/wf-4-0-designer-type-visibility.aspx</link><pubDate>Fri, 13 Feb 2009 00:03:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9415824</guid><dc:creator>mwinkle</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/9415824.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=9415824</wfw:commentRss><description>&lt;p&gt;One of the exercises I'm going through now is scrubbing our API and taking a hard look at types marked as public and trying to decide &amp;quot;does it really need to be public.&amp;quot;&amp;#160; While on first blush, you can    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;What I'd love to get from folks are answers to the following questions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Were there designer types in 3.0/3.5 that were not public that caused you problems?&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;If so, why?&amp;#160; What and how did you want to use that type?&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Were there scenarios where you found our decisions on type visibility odd, inconsistent or painful?&amp;#160; Let me know what those were.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Looking forward to your thoughts!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9415824" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf/default.aspx">wf</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/vNext/default.aspx">vNext</category></item><item><title>SOA&amp;BP Conference Announcements, "Oslo"</title><link>http://blogs.msdn.com/mwinkle/archive/2007/10/30/soa-bp-conference-announcements-oslo.aspx</link><pubDate>Tue, 30 Oct 2007 22:37:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5785173</guid><dc:creator>mwinkle</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/5785173.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=5785173</wfw:commentRss><description>&lt;p&gt;This morning at the SOA&amp;amp;BP Conference, we talked about &lt;a href="http://www.microsoft.com/presspass/press/2007/oct07/10-30OsloPR.mspx"&gt;Oslo&lt;/a&gt; for the first time.&amp;#160; For me, this is a big day, as it marks the point where the rest of the world knows what a lot of people have been and will continue to be working on.&amp;#160; &lt;a href="http://www.microsoft.com/presspass/exec/wahbe/default.mspx"&gt;Robert Wahbe&lt;/a&gt;, the VP of Connected Systems, mentioned in the keynote that Oslo can be best viewed as a series of investments that span a number of release cycles. &lt;/p&gt;  &lt;p&gt;What does this mean for me, a WF developer (note, these are my interpretations).&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A vehicle for further investments in WF and WCF.&amp;#160; There will be a ton of enhancements in order to enable new scenarios, take the idea of modeling processes in an executable workflow to the next level, and drive performance and functional stuff.&lt;/li&gt;    &lt;li&gt;Moving WF to the next level, by making it a first class citizen in this modeling world, by making rules and other artifacts get elevated into a way to modeled, managed, deployed and monitored.&lt;/li&gt;    &lt;li&gt;Getting a chance to look at what people are doing with v1, and what lessons we can learn from it.&amp;#160; In Orcas, the stuff that we did was purely additive.&amp;#160; This longer release gives us a chance to enhance and improve and address things that we couldn't do in the Orcas timeframe.&amp;#160; There's some really exciting work going on here that I'm looking forward to talking about more in the future.&lt;/li&gt;    &lt;li&gt;Finally, it gives us a better way to tell the WF hosting story, in that we will have a host and way to manage and deploy and execute WF and WCF in an host we will deliver, rather than requiring a &amp;quot;build on your own&amp;quot; approach (which still remains an option for folks who have specific hosting requirements).&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Our marketing folks always get nervous when we start talking about &amp;quot;revolutionary&amp;quot; technology (although, maybe it would get us some more Apple &lt;a href="http://en.wikipedia.org/wiki/1984_%28television_commercial%29"&gt;1984 like commercials&lt;/a&gt; :-) ).&amp;#160; I've always seen workflow as a very transformational technology.&amp;#160; I see the things that are coming in Oslo as a very natural, evolutionary step, in the process of what I believe has been, and will continue to be a revolutionary way of making us be more productive developers.&lt;/p&gt;  &lt;p&gt;Finally, given some of the past history people have had with version numbers, I would not get caught up in the version numbers mentioned in press release.&amp;#160; As one of the marketing guys told me, &amp;quot;The quotes mean something,&amp;quot; which, translated means &amp;quot;The numbers are just placeholders indicating a major release beyond where we are currently at.&amp;quot;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5785173" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf/default.aspx">wf</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/vNext/default.aspx">vNext</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/Oslo/default.aspx">Oslo</category></item><item><title>Activities Survey</title><link>http://blogs.msdn.com/mwinkle/archive/2007/10/18/activities-survey.aspx</link><pubDate>Fri, 19 Oct 2007 00:29:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5513801</guid><dc:creator>mwinkle</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/5513801.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=5513801</wfw:commentRss><description>&lt;p&gt;So, we're getting close to .NET 3.5 getting out the door, and as always we're thinking about what comes next.&amp;#xA0; The activities team is looking how to make activities better going forward, and they are very interested in what you have to say, how you have been using them and how you'd like to use them.&lt;/p&gt;  &lt;p&gt;This feedback will help us understand how to shape the future of things and how we should think about the pain points you are experiencing.&lt;/p&gt;  &lt;p&gt;&lt;a href="https://live.datstat.com/MSCSD-Collector/Survey.ashx?Name=WF_Activities_Survey_blog"&gt;Fill survey out here!&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5513801" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf/default.aspx">wf</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/activities/default.aspx">activities</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/vNext/default.aspx">vNext</category></item></channel></rss>