<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Windows Workflow Foundation</title><link>http://blogs.interknowlogy.com/adamcalderon/category/94.aspx</link><description>Interesting tidbids that cover WF</description><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.111</generator><item><dc:creator>Adam Calderon</dc:creator><title>Programming Windows Workflow Foundation Book Review</title><link>http://blogs.interknowlogy.com/adamcalderon/archive/2007/04/22/12966.aspx</link><pubDate>Sun, 22 Apr 2007 15:01:00 GMT</pubDate><guid>http://blogs.interknowlogy.com/adamcalderon/archive/2007/04/22/12966.aspx</guid><description>&lt;p&gt;I just recently finished reading &lt;a href="http://www.amazon.com/Programming-Windows-Workflow-Foundation-Techniques/dp/1904811213/ref=pd_bbs_4/103-1256937-0127811?ie=UTF8&amp;s=books&amp;sr=8-4"&gt;Programming Windows Workflow Foundation (Practical WF Techniques and Examples using XAML and C#)&lt;/a&gt; by K. Scott Allen and thought I would share my views on this very practical book. &lt;/p&gt;
&lt;p&gt;I have been working with WF for quite a while and one of the hardest things about this technology is getting your hands around everything it can do. Scott has done a great job of walking you through the technology in a manner that enables you to not only grasp the concepts but also get some code up and running quickly. The progression of the book was well thought out getting you started on creating workflows [Chapter 2] and then progressing through sequential workflows [Chapter 3], base activities [Chapter 4], custom activities [Chapter 5], hosting workflows [Chapter 6], State Machine Workflows [Chapter 7], workflow communication [Chapter 8] and finally rules and conditions [Chapter 9]. The thing that I like about this approach is typically in most projects you will have a team of varying roles and skills and the book in my view caters to this by tackling WF development from the perspective of a workflow developer (Chapters 1,2,3,4,7,9) early on in the book and then moving to a host developer (Chapters 5,6,8) for the final half of the book. You will notice I grouped chapters 7 and 9 in with the first half of the book since I feel these topics are very workflow developer centric and the introduction to the local communication service in chapter 3 should give you enough information to tackle these topics earlier than they are presented.&lt;/p&gt;
&lt;p&gt;This book is a fast paced book that is designed to get you up and running quickly but at the same time is not so huge that you can&amp;#8217;t get through it quickly. It&amp;#8217;s size (233 pages) limits what you can cover but I think Scott does a good job of presenting the topics in a detailed enough manner that you can then dive into the SDK if you need to go deeper and know what you are looking for when you do. The book has all of code online at &lt;a href="http://www.packtpub.com/support"&gt;Packt Publishing&lt;/a&gt; which makes it easy to follow along as you read the book. I would recommend this book to someone who is new to WF and needs a book that can quickly guide them through getting started with the technology. &lt;/p&gt;&lt;img src ="http://blogs.interknowlogy.com/adamcalderon/aggbug/12966.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Adam Calderon</dc:creator><title>Latest Workflow Article in .NET Developers Journal</title><link>http://blogs.interknowlogy.com/adamcalderon/archive/2007/02/05/11275.aspx</link><pubDate>Mon, 05 Feb 2007 16:20:00 GMT</pubDate><guid>http://blogs.interknowlogy.com/adamcalderon/archive/2007/02/05/11275.aspx</guid><description>&lt;p&gt;My latest article&amp;nbsp;&lt;a href="http://dotnet.sys-con.com/read/319760.htm"&gt;Using Workflow Foundation in creating dynamic navigation applications in ASP.NET&lt;/a&gt;&amp;nbsp;is now available online. The sample application referenced in the article&amp;nbsp;is unfortunately not on the website so I included it here.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.interknowlogy.com/downloads/adamcalderon/WebNavigationDemo.zip"&gt;File Attachment: WebNavigationDemo.zip (248 KB)&lt;/a&gt;&lt;/p&gt;&lt;img src ="http://blogs.interknowlogy.com/adamcalderon/aggbug/11275.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Adam Calderon</dc:creator><title>WF XAML vs Code</title><link>http://blogs.interknowlogy.com/adamcalderon/archive/2007/01/12/10711.aspx</link><pubDate>Fri, 12 Jan 2007 18:41:00 GMT</pubDate><guid>http://blogs.interknowlogy.com/adamcalderon/archive/2007/01/12/10711.aspx</guid><description>&lt;p&gt;I have been working with Windows Workflow Foundation (WF) for quite a while now and have been going back and forth on&amp;nbsp;how I want to have the designer create my workflow. I figured I would blog about what I know (pro and con) about the two methods and see if I can spark some debate on the subject. The decision on how the workflow is created is&amp;nbsp;made every time&amp;nbsp;you choose a workflow template from the Visual Studio Designer. The two&amp;nbsp;choices&amp;nbsp;are (1) workflow with definition expressed as Xaml and user code in a separate code file or (2) workflow with definition and user code in same code file. These description of option 2 is a little off (I took it from the VS designer) because two physical files are really created one where you put your code and the second where VS puts it&amp;rsquo;s code and is in the form &amp;ldquo;xxx.designer.cs&amp;rdquo; in my case since I use C#. So what&amp;rsquo;s the big deal you ask? &lt;/p&gt;
&lt;p&gt;The deal with the two&amp;nbsp;workflow&amp;nbsp;formats listed above is how you use them, how easy it is to work with them and how hard it is to&amp;nbsp;modify things. How you use them really focuses on one thing which is are you going to work with the workflows dynamically. If not than you really don&amp;rsquo;t care how they are represented. If you work with a workflow dynamically using XAML&amp;nbsp;you going to load the workflows using an XmlReader&amp;nbsp;like this.&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (XmlReader reader = XmlReader.Create("Workflow1.xoml"))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WorkflowInstance instance = workflowRuntime.CreateWorkflow(reader);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; instance.Start();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;If you plan to do things this way you have a few things to consider. One is how difficult it is going to be to edit the XAML since currently there is no intellisence support in VS for it. Second is how hard it is going to be to debug things. Here is a contrived example I came up with. The following works and there are not errors.&lt;/p&gt;
&lt;p&gt;&amp;lt;SequentialWorkflowActivity x:Class="WorkflowRepresentationChoices.Workflow2" x:Name="Workflow2" xmlns:x="&lt;A href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/A&gt;" xmlns="&lt;A href="http://schemas.microsoft.com/winfx/2006/xaml/workflow"&gt;http://schemas.microsoft.com/winfx/2006/xaml/workflow&lt;/A&gt;"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;CodeActivity x:Name="codeActivity1" ExecuteCode="codeActivity1_ExecuteCode" /&amp;gt;&lt;br /&gt;&amp;lt;/SequentialWorkflowActivity&amp;gt;&lt;/p&gt;
&lt;p&gt;Next I changed CodeActivity to CodeeActivity.&lt;/p&gt;
&lt;p&gt;&amp;lt;SequentialWorkflowActivity x:Class="WorkflowRepresentationChoices.Workflow2" x:Name="Workflow2" xmlns:x="&lt;A href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/A&gt;" xmlns="&lt;A href="http://schemas.microsoft.com/winfx/2006/xaml/workflow"&gt;http://schemas.microsoft.com/winfx/2006/xaml/workflow&lt;/A&gt;"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;CodeeActivity x:Name="codeActivity1" ExecuteCode="codeActivity1_ExecuteCode" /&amp;gt;&lt;br /&gt;&amp;lt;/SequentialWorkflowActivity&amp;gt;&lt;/p&gt;
&lt;p&gt;Now when I compile I get the following error &amp;ldquo;Could not deserialize object. The type 'System.Workflow.Activities.CodeeActivity' could not be resolved.&amp;rdquo;. The problem with this is that I don&amp;rsquo;t get much help from the editor in where this is. No squiggly&amp;nbsp;lines or anything. Now this is by no means a show stopper but it is a productivity issue that you should think about. To continue on the debugging topic for just a little more think about the errors you could encounter when calling workflowRuntime.CreateWorkflow(reader) in the above code sample. If the XAML has errors like our contrived example above you will be dealing with the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.workflow.componentmodel.compiler.workflowvalidationfailedexception.aspx"&gt;WorkflowValidationFailedException&lt;/a&gt;&amp;nbsp;which is thrown if the XAML is invalid. This exception will contain data that you can use to figure out what is going on but again this is another added level of complexity you need to be aware of. Finally there is the issue of code behind. Since the XAML is just that a XAML file your code behind is not included. This changes how you can create a workflow and really forces you to use a more complex approach to workflow development that can sometimes require creating a custom activity to perform some simple logic that could have been done in code behind. So before you read on I want to make one thing clear. The XAML approach is not bad and provides possibilities not available in the code version but there are some things to think about if you use it. &lt;/p&gt;
&lt;p&gt;Now let&amp;rsquo;s look at the code version. This style is similar to what the WinForms designer has been doing for a while. You have a series of .NET code statements that build up a workflow. The above activity example looks like this in the code version.&lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt; &lt;br /&gt;/// Required method for Designer support - do not modify &lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;System.Diagnostics.DebuggerNonUserCode]&lt;br /&gt;private void InitializeComponent()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.CanModifyActivities = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.codeActivity1 = new System.Workflow.Activities.CodeActivity();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // codeActivity1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.codeActivity1.Name = "codeActivity1";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.codeActivity1.ExecuteCode += new System.EventHandler(this.codeActivity1_ExecuteCode);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Workflow1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Activities.Add(this.codeActivity1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Name = "Workflow1";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.CanModifyActivities = false;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The work in the code behind version happens in the InitializeComponent method and at the end of the method the Code activity is added to the workflow. So with this approach you do get intellisence and it is easy to debug but it&amp;rsquo;s a little harder to read and you don&amp;rsquo;t get any ability to dynamically bring in a workflow since the code to create it (see below) requires&amp;nbsp;the type of the workflow. Now I want to say that you can create a workflow dynamically in this case but you have to use a little reflection to make it happen and it&amp;rsquo;s not a easy as the above XmlReader code.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using(WorkflowRuntime workflowRuntime = new WorkflowRuntime())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(WorkflowRepresentationChoices.Workflow1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; instance.Start();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The other thing in your favor here is that the workflow will be compiled and validated when you load it. In the case of the XAML and the XmlReader the validation occurs as the workflow is created.&lt;/p&gt;
&lt;p&gt;So with all of this said what do you choose? If you are a code person you choose the code version and if you need to do things dynamically you use reflection. If you are an xml person you use XAML and you design you workflows in an abstract manner (use activities for everything) if you want to load them dynamically. Of course if you are doing things dynamically and do have a bunch of files in a directory, being able to open them up in an editor and seeing what they do can be helpful. For me I so desperately want a full fledged intellisense XAML editor that I can use to go back and forth with like I can do in WPF. I just love that experience.&lt;/p&gt;&lt;img src ="http://blogs.interknowlogy.com/adamcalderon/aggbug/10711.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Adam Calderon</dc:creator><title>I am teaching a class on Windows Workflow Foundation</title><link>http://blogs.interknowlogy.com/adamcalderon/archive/2007/01/08/10584.aspx</link><pubDate>Mon, 08 Jan 2007 21:32:00 GMT</pubDate><guid>http://blogs.interknowlogy.com/adamcalderon/archive/2007/01/08/10584.aspx</guid><description>I will be teaching a class on&amp;nbsp;Windows&amp;nbsp;Workflow Foundation&amp;nbsp;at UCSD Extensions starting on January 22. I am totally impressed with the folks at UCSD Extensions for being at the cutting edge and offering a class like this so early. If you are interested in learning more about the&amp;nbsp;class please visit &lt;a href="http://www.extension.ucsd.edu/studyarea/index.cfm?vAction=singleCourse&amp;amp;vCourse=CSE-40989&amp;amp;vStudyAreaId=14"&gt;UCSD Extensions&lt;/a&gt;&amp;nbsp;&lt;img src ="http://blogs.interknowlogy.com/adamcalderon/aggbug/10584.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Adam Calderon</dc:creator><title>WF Presentation at San Diego .NET Developers Group</title><link>http://blogs.interknowlogy.com/adamcalderon/archive/2006/10/04/6108.aspx</link><pubDate>Wed, 04 Oct 2006 10:24:00 GMT</pubDate><guid>http://blogs.interknowlogy.com/adamcalderon/archive/2006/10/04/6108.aspx</guid><description>&lt;p&gt;Thanks for showing up to my presentation on Windows Workflow. Here are the slides and demo code. If you are interested I will be teaching a class on Windows Workflow at UCSD Extensions. Here is the link: &lt;a href="http://www.extension.ucsd.edu/studyarea/index.cfm?vCourse=CSE-40989"&gt;http://www.extension.ucsd.edu/studyarea/index.cfm?vCourse=CSE-40989&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;A href="http://blogs.interknowlogy.com/downloads/adamcalderon/Introduction_20to_20Windows_20Workflow_20Foundation.ppt"&gt;File Attachment: Introduction to Windows Workflow Foundation.ppt (2176 KB)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;A href="http://blogs.interknowlogy.com/downloads/adamcalderon/Intro_20to_20WF.zip"&gt;File Attachment: Intro to WF.zip (502 KB)&lt;/a&gt;&lt;/p&gt;&lt;img src ="http://blogs.interknowlogy.com/adamcalderon/aggbug/6108.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Adam Calderon</dc:creator><title>XAML a closer look</title><link>http://blogs.interknowlogy.com/adamcalderon/archive/2006/07/21/3319.aspx</link><pubDate>Fri, 21 Jul 2006 17:08:00 GMT</pubDate><guid>http://blogs.interknowlogy.com/adamcalderon/archive/2006/07/21/3319.aspx</guid><description>&lt;P&gt;XAML (Extensible Application Markup Language) is an xml based language for creating trees of .NET objects. It is being used not only in Windows Presentation Foundation (WPF) but also in Windows Workflow Foundation (WF). The strenght behind this language is it&amp;#8217;s human readable and writeable. This channel 9 video &lt;A href="http://channel9.msdn.com/showpost.aspx?postid=212481"&gt;There's Something About XAML&lt;/A&gt;  presented by Rob Relyea a Program Manager on the WPF team talks about the history of XAML, how it's been designed, how it works, what a BAML file is and what's in it, how the build process works, thoughts on debugging, tooling, and much more. This is a really cool video with lots of great content.&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;&lt;img src ="http://blogs.interknowlogy.com/adamcalderon/aggbug/3319.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>