Workflow Foundation Tracking Birds of a Feather (BOF) at Tech Ed 2007

by Matt Milner 31. May 2007 05:40
I'm excited to be hosting a BOF this year at Tech Ed on the tracking services in Windows Workflow Foundation.  If you are interested in talking about tracking in general, the use of the included SQL tracking and query APIs, or custom tracking services to solve real business problems, then be sure to attend.  I think it will be a lot of fun to see how people use this technology as it is the key piece to real visibility in your workflows.  Hope to see you there. 
 
Session details (check schedules at Tech Ed to verify time and room):
BOF24: Windows Workflow Tracking in Action
Thursday, June 7, 2007 at 4:30 PM
Room S331

Tags:

General Musings | Windows Workflow Foundation

Templates for Windows Workflow XAML activation projects

by Matt Milner 21. May 2007 09:43
One of my frustrations with Windows Workflow Foundation, is that there is no easy way in Visual Studio to create pure XAML workflows.  The tools really drive you toward compiling the XAML into a .NET assembly.  That, to me, defeats the purpose of using XAML.  So I created a bunch of project templates (console/library & state/sequence) that create pure XAML workflows using XAML activation.  This means the workflows are not compiled, the XAML is just copied into the build directory.  The console application project templates are setup in their program.cs to load these XAML files using an XMLReader and activate them that way. 
 
I also started working on XAML item templates so you could add individual items to a project. The problem I am having is I don't think there is a way in the project template directly to indicate that the file should be treated as content type of None and copied to the output.  I might have to write a custom wizard to get that part working.  If anyone has any easier means of accomplishing this, let me know. 
 
[Update]: I've updated the program.cs files in the templates to reflect some excellent feedback from my colleague Jon. The program now has template code to handle common exceptions when processing XAML files and also provides hooks to add types into a type provider.  In addition, I figured out that the wizard for the item templates was only a few lines of code.  To get the item templates working, you'll need to build the solution in the zip file and then either a) deploy the assembly to the GAC or to the VS\Common7\ide folder.  It needs to be in one of these two places for the VS template engine to trust it. 
 
Any feedback or questions, please post them in the comments.
 
Enjoy!

Tags:

Windows Workflow Foundation

Double-clicking to open Visual Studio solution files on Vista

by Matt Milner 21. May 2007 08:11
I got so tired of not being able to double-click my solution files in the Windows explorer that I finally figured out how to fix it.  First of all, I should mention that I'm running with UAC on in Vista and that I have VS configured to run as an admin.  So, I get prompted each time I start it, but that's OK, it’s a good reminder that I am running elevated and should test my code without the admin privileges. 
 
I was trying to figure out why, when my VS is set to run as admin, double-clicking would not work.  The thing that jumped out at me is that VS is not the default program for SLN files.  The Visual Studio Version Selector is the default program.  My first thought was to run that selector as admin all the time, but that didn't work.  So, I decided I don't need a version selector since I only have one version of VS on my machine right now, and mapped SLN files to DevEnv.exe.  Now, when I double click them, I get the UAC prompt and then it opens right up in Visual Studio. 
 
Hopefully this helps someone else with this little annoyance. 

Tags:

General Musings

My Tech Ed Presentations

by Matt Milner 14. May 2007 06:01
I'm excited to be presenting at the upcoming Tech Ed 2007 event in Orlando next month.  I'm doing two different sessions for the Connected Systems Division (SOA track); one on BizTalk R2 and one on Windows Workflow.  If you are heading to Tech Ed, I hope you'll join me if the topics interest you (which presumably they do or you wouldn't be reading this blog!). 
 
SOA317 - Building Connected Systems on the Microsoft .NET Framework Using the Windows Communication Foundation Adapter in BizTalk Server 2006 R2
Tuesday, 8:30 AM
Deep Dive Chalk talk to follow at 10:15 in the Blue Theater
 
SOA223 - Custom Activities with Microsoft Windows Workflow Foundation: A Developer's Primer
Monday, 4:45 PM
 

Tags:

BizTalk Server | General Musings | Windows Workflow Foundation

Article on ActivityExecutionContext in Windows Workflow up on MSDN

by Matt Milner 14. May 2007 05:51
The June issue of MSDN magazine is up on MSDN website and for the Foundations column I wrote about the ActivityExecutionContext in WF.  In my opinion, this extremely important aspect of WF gets little attention, yet causes a lot of the developer frustration.  I hope you enjoy and that it is helpful.  Feedback is always welcome. 
 
 

Tags:

Windows Workflow Foundation

MSDN Magazine article on Windows Workflow tracking is live

by Matt Milner 16. February 2007 08:06
My first article in the Foundations column on Windows Workflow Foundation is now live on the MSDN Magazine site.  I find tracking to be one of the most powerful features of WF and easily the most frequently used extension model, outside of custom activities, to solve real business problems.  The article was fun to write and I'm having fun finishing up the next installment on the ActivityExecutionContext.  That one should be published in the June issue. 
 
Enjoy and as always, any feedback is welcome. 

Tags:

Windows Workflow Foundation

New public course RSS feed

by Matt Milner 16. February 2007 03:08
One of my students in the November Windows Workflow class suggested that we have an RSS feed for our public courses so people can easily stay up to date on where and when we are offering courses.  Now you can thanks to Aaron.  You can get to the blog or right to the RSS feed.  These entries will also show up in our Pluralsight aggregated feed, so if you are already subscribed to that, you will get the entries through that RSS feed also.  Other suggestions are always welcome and I look forward to seeing you in a class soon! 
 
Note that right now we have a single class on the feed, my Applied BizTalk Server class coming up in March.  We didn't want to flood the aggregate feed with all of our upcoming classes so we will add them in gradually. 

Tags:

General Musings

BizTalk, BizTalk, MVP and more BizTalk (March Open Enrollment)

by Matt Milner 7. February 2007 09:24
I've been crazy busy lately with BizTalk Server.  First, I'm happy to announce that Microsoft has recognized me as an MVP for BizTalk Server (and I got nominated for the Connected Systems group as well)!  I'm very pleased and look forward to doing as much as I can in the community this year to earn the reward. 
 
As for teaching BizTalk, I'm doing three deliveries of our Applied BizTalk Server for internal Microsoft groups, two of which are India.  So, I've just returned from Hyderabad and I'm heading back in a week and a half.  It is wreaking havoc on my internal clock, but the groups are great and I had a lot of fun teaching the class.  Awesome questions and great discussions as many of these people are working with BizTalk daily and already have some areas they wanted to understand more about. 
 
It was also fun to visit Hyderabad.  I've been to Bangalore once a year ago, so it was interesting to compare.  Microsoft has an impressive facility there and they are continuing to build.  A very exciting time for the city and the people from what I could tell.  I'm looking forward to my return trip and some more excellent Indian food (the Biryani was an especially good local specialty available right in the MS dining hall).  I also got some lessons in Cricket. I knew nothing going in, and I'm still mostly in the dark but at least not completely in the dark.  I have several pieces of information to help me know how it is different from baseball, as opposed to just knowing that it is different, which is where I started. 
 
I'm also frantically "playing" with some early bits of BizTalk R2.  I've got some upcoming talks where I am going to be showing BTS with WCF, WF and other technologies under the Connected Systems umbrella. So, I have some demos to get working so I don't get booed off the stage. :)  More on these talks in another post. 
 
Finally, I am doing an open enrollment BizTalk course here in Minneapolis in March.  If you want to get the best training on BizTalk Server (modest aren't I) then sign up on the course information page. I'd like to guarantee that the temperature won't be below 0 when you come, but who knows.  :)  Either way, it will be a fun informative week.   
 
 

Tags:

BizTalk Server | General Musings

How to get workflow data/properties at runtime

by Matt Milner 25. November 2006 15:22
I've seen many people in the forums trying to figure out the best way to get data from a workflow at runtime.  The root of the problem lies in the fact that while you can get a handle to a WorkflowInstance from the runtime, this is really a template and does not contain the values of properties on the workflow.  It is a common need to get the current state of your process, or get values from the class. 
 
One solution is to use the local communications activities and call back to the host and have a local service manage the values.  But, who wants to drop a bunch of CallExternalMethod activities in all of their workflows.  No the answer, not surprisingly, lies with tracking. 
 
Tracking in workflow provides so much power and flexibility to extract data that you are interested in. I've created a custom tracking service which tracks the workflow properties at runtime and stores them in a dictionary in the service.  When you want to get the current property values for a workflow, you get the tracking service from the runtime, then ask it for the properties which you get back as a Dictionary<string, object> just like the parameters you passed into the workflow. 
 
There are two keys to getting this work and both revolve around the tracking profile.  First, it is important to know that when you define an ActivityTrackPoint, you can add data extracts which define the data to extract and send to the tracking channel.  But those extracts can either be activity extracts, or workflow extracts.  So, I define an activity track point to track all activities on close and add Workflow level extracts to pull the properties off of the workflow at that point.  The second key piece is figuring out what properties are available on each workflow type.  This service would be pretty limited if it were tied to a specific workflow type.  Instead, when the profile is created based on a workflow type, I reflect on the type to get the public properties defined in this type (not the base classes though you can do that too) and build the extract definitions from them. 
 
So, when a workflow is run, the profile is created indicating that on each activity closed, the properties of the workflow should be sent to the tracking channel.  In the channel, I simply update the dictionary of values stored in the service.  Finally, when an instance completes or terminates, I remove the values from the dictionary. 
 
You could track more often by using other statuses on the activity tracking location, but beware of the overhead tracking may add in these cases. 
 
I hope this is helpful.  As always, comments and feedback are welcome. 

Tags:

Windows Workflow Foundation

MSDN Magazine article on building custom activities for workflows

by Matt Milner 20. November 2006 08:19
My article on building custom activities for Windows Workflow Foundation has finally posted to MSDN.  For those of you fortunate enough to get a printed copy, you got an entire week advanced screening. :) 
I tried to cover the basics of building an activity and the various components; designer, validator, etc, as well as touch on some of the things you can do for more advanced activities that need to listen for external data/events. 
 
I'll be writing more articles for MSDN Magazine on Windows Workflow Foundation in the coming months. If you have specific topcis that are of interest, post your feedback here and I'll consider it as I plan the next articles. 
 

Tags:

Windows Workflow Foundation

Pluralsight Developer Training

View my developer training videos on Pluralsight.

Pluralsight .NET Training