I will continue from my last post on authoring SharePoint workflows in VS 2008 by providing a walkthrough.
In order to work with SharePoint workflows in VS you will have to setup your development machine as follows:
1) Install Windows Server 2003.
2) Install Internet Information Services (IIS). (In Control Panel, Add/Remove Windows Components, Application Server, Details, Internet Information Services (IIS).)
3) Install .NET Framework 2.0 and.NET Framework 3.0.
4) Enable ASP.NET 2.0.5727 in IIS Manager.
5) Install Microsoft Office SharePoint Server 2007 (MOSS). Make sure to run the configuration wizard. [Edit: May 29: WSS is not supported]
6) Install Visual Studio 2008. Use the default installation, or make sure that Visual Studio Tools for Office is selected on the Custom installation page of the Setup wizard.
Some questions that come to mind - Firstly, why only Windows Server 2003 (no Windows Xp)? Well MOSS/WSS can only be installed on a Windows Server machine. And secondly, why does MOSS/WSS need to be installed on the development machine? It's just required to do any (not just workflow) practical SharePoint development since you have to do an iisreset, access the GAC etc.
Is the above installation order important? Yes and no. If you install SharePoint before Visual Studio, your toolbox for Workflow development comes initialized with all SharePoint related activities. So it is a good idea to install in that order. If you do not do so - you will have to reset your toolbox (Right click on the toolbox and select 'Reset toolbox') once you start developing SharePoint workflows.
Project Creation - Select the 'SharePoint 2007 Sequential Workflow'
New SharePoint Workflow wizard: A wizard shows up that allows you to specify the parameters for debugging - the name of the worklfow, the local SharePoint site (no support for remote SharePoint sites) on which to deploy the workflows, the list to associate it with, the task and history list to work with. Also you can specify, how you intend to start your workflow on F5.
Select the parameters for workflow association on F5:
Workflow designer:On pressing 'Finish' in the wizard, the workflow designer shows up.
Property Window:A few additions to note include a property window that allows you to view/change the selections you made in the wizard. The property window is visible when you have the project node selected in the Solution Explorer.
Breakpoint: You can go ahead an now put a breakpoint in the workflow activity in the designer, by right clicking the activity and selecting 'Insert breakpoint' from the context menu.
Press F5 now to start debugging and you will notice the output window shows all the deployment details - Install the assembly to the GAC, restart IIS, copy workflow.xml, feature.xml, and any other resource files/InfoPath forms you may have, install and activate the workflow template as a feature in SharePoint, associate the workflow with the list you specified in the wizard.
In the browser window that launches you will see the deployed workflow.
After you manually start the instance of the workflow, you will see the breakpoint being hit:
Btw. my technorati profile is getting started here: Technorati Profile.