Templates for Windows Workflow XAML activation projects

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!

Posted May 21 2007, 03:43 PM by matt-milner

Comments

Rob Relyea wrote re: Templates for Windows Workflow XAML activation projects
on 05-21-2007 1:46 PM
My guess is that you need a wizard to set the build action...yes, it is a bummer.

Thanks, Rob Relyea
Program Manager, Xaml Language Team
http://rrelyea.spaces.live.com
CallContext wrote WWF templates for XAML only workflows
on 05-22-2007 2:43 PM
A little something from Matt Milner to help with creating XAML only workflows. There's a couple of templates...
Christopher Steen wrote Link Listing - May 24, 2007
on 05-24-2007 8:06 PM
WCF Security References [Via: nluria ] Smart Client Software Factory v2 is now available [Via: Public...
Christopher Steen wrote Link Listing - May 24, 2007
on 05-24-2007 8:09 PM
WCF Security References [Via: nluria ] Smart Client Software Factory v2 is now available [Via: Public...
Jim Larson wrote re: Templates for Windows Workflow XAML activation projects
on 03-11-2008 1:18 PM
Suppose a person wants to include a code activity in a xoml only workflow. How does one define the code for the activity? The ExecuteCode handler property generates errors.
Matt Milner wrote re: Templates for Windows Workflow XAML activation projects
on 03-11-2008 8:47 PM
Jim,
If you want a XAML only workflow and you don't want to compile it, then you can't include code in the workflow defition. That leaves you with two options:
1) Don't use the code activity or try to hook up event handlers in your workflow. While I don't recommend using the code activity (b/c custom activities are really simple to write) there are cases where you might need an event handler.
2) Bind the event to a handler defined in either a) base workflow type that you use instead of the Sequential or State workflows or b) another activity.

It is possible to embed code into a XAML workflow, but then that workflow has to be compiled, which kind of defeats the purpose, in my opinion.

Sven wrote re: Templates for Windows Workflow XAML activation projects
on 05-01-2008 6:19 AM
Does this work with VS 2008, too? Doesn't seem so ???
Matt Milner wrote re: Templates for Windows Workflow XAML activation projects
on 05-01-2008 2:44 PM
Yes, this does work with VS 2008, but you have to follow the directions in the post for 2008. So the project templates have to get installed in the correct directories (under the 2008 directory in your my documents) and they assembly used by the item template needs to get installed into the VS directory for 2008. If you have them installed, you should just be able to copy the templates and the assembly from the 2005 folders to the 2008 folders.
larson ps wwf wrote larson ps wwf
on 07-09-2008 10:23 PM

Pingback from  larson ps wwf

Add a Comment

(required)  
(optional)
(required)  
Remember Me?