5,276,156 members and growing! (16,066 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Windows Workflow Foundation » Applications     Beginner License: The Code Project Open License (CPOL)

SharePoint Workflow Wizard in Visual Studio 2008

By Nishith Pathak

SharePoint Workflows Wizard in Visual Studio 2008
C# (C# 2.0, C#), .NET (.NET, .NET 3.0), Visual Studio (VS2008, VS), ASP.NET, WebForms, Design, SysAdmin, CEO, Arch, DBA, Dev, QA

Posted: 16 May 2008
Updated: 16 May 2008
Views: 4,450
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
6 votes for this Article.
Popularity: 3.02 Rating: 3.88 out of 5
0 votes, 0.0%
1
1 vote, 16.7%
2
2 votes, 33.3%
3
1 vote, 16.7%
4
2 votes, 33.3%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

Introduction

Visual Studio tools for office 2008 provides variety of workflow templates. Ofcourse, these workflow templates are based on Windows Workflow foundation (WF) . Continuing the efforts of integrating the other technologies usage and making the Visual Studio as a single UI IDE for developing various components of different technology, Microsoft have came up with few workflow templates specific for SharePoint in Visual Studio tools for office. This article will give you sneak preview about the sharepoint workflows and also provide details on why should we use the sharepoint workflow templates of Visual studio 2008. Visual Studio 2008 provides lot of workflow templates. If you see the screen , two of those belong to SharePoint.

1. SharePoint 2007 Sequential workflow
2. SharePoint 2007 State Machine workflow

Brief Overview

Sequential workflow represents a workflow as a sequence of steps that must be executed in order until the last activity is completed. A state machine workflow represents a set of states,transitions, and actions. One state is denoted as the start state, and then, based on an event, a transition can be made to another state. On the right side is a typical example of a Sequential workflow. When you select any of these workflow templates, it executes the workflow wizard that allows debugging on the workflows on SharePoint that requires special permissions. For e.g. this wizard takes care of deploying workflow customization on Global Assembly Cache (GAC).

2.JPG

Step 1. Select the workflow and the site for debugging

As soon as you select any of the workflow templates, (for this article, I am assuming that you selected the SharePoint 2007 Sequential Workflow), it presents a simple Wizard during project creation to capture settings in an easy-to-use Wizard. In the first step, it asks you to give the workflow a name and also choose a valid SharePoint site where the workflow will be deployed and debugged. One thing would be a restriction on this site selection is that this site should be a local site and cannot be a remote SharePoint site. I hope this issues gets resolved in upcoming SP1 version of VS 2008 . Click on "Next" to move to next step.

3.JPG

Step 2 : Choosing the library or list

Since you have selected the SharePoint site on the first step, this time you need to associate the workflow template with a document library or list. Before the VSTO 2008, this work has to be outside by going in the IDE of SharePoint. In this , you choose the document library or the lists. One thing to be aware is that, this wizard does not allow you to create new lists or library. This work has to be still done either manually by going to SharePoint or by using SharePoint object Model. Click on "Next" to move to next step.

4.JPG

Step3. : Invoking a workflow

On the last step, wizard lets you configure how an instance of your workflow can be started. There are three ways as shown on the screen

1. Manually by users

2. When an item is created

3. When an item is changed

The first two are selected by default for the easy. After setting these simple configurations in place, the wizard completes, and VSTO creates the new project.

5.JPG

Project created : Lets play now

After setting this, a project gets created and by default , few files like features.xml, workflow.xml etc gets created. Now you if you are an expert on workflow foundation, This is your time to do something with the workflow based on your business requirement. Once done, deployment is also as easy as pressing F5. Once deployment, workflow can be debugged by well within the Visual Studio IDE

6.JPG

Conclusion

Earlier debugging the workflow developed in WF and deployed in SharePoint requires a lot of manual steps to be done. These SharePoint workflow templates have brought a sigh of relief for all those developers. This simple wizard has really avoided lot of manual process. I am sure there are much more you will find in Visual studio 2008.

Happy Coding

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Nishith Pathak


Nishith Pathak is an avid reader,Prolific writer, Speaker for Microsoft India,Published Author of APress and a Microsoft Purist.He is MVP, MCPD, MCTS MCSD.Net,MCAD.Net(EA),MCSD. His proficiency lies in exploring Microsoft technology and to share them with other peers. He is a contributing author and an avid technical reviewer for multiple electronic and print publications. He has recently co-authored a book on WCF called Pro WCF: Microsoft Practical SOA Implementation for APress Inc, USA. Over the years, he has also been involved in providing consultancy and training services to corporations. He has been awarded with Microsoft Most Valuable Professional (MVP).Working since beta version of .Net makes his competecy in .Net. He can be contacted at NisPathak@Hotmail.com or at his blog http://DotNetPathak.Blogspot.com. Currently he is focused on key areas of the Microsoft platform, specifically Distributed Computing, service orientation and exploring VISTA and help companies architecting solutions based on Service Oriented Architecture.
Occupation: Web Developer
Location: India India

Other popular Windows Workflow Foundation articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 1 of 1 (Total in Forum: 1) (Refresh)FirstPrevNext
Subject  Author Date 
QuestionWF in VS 2008 on Client machinemembernmq16hrs 31mins ago 

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 16 May 2008
Editor:
Copyright 2008 by Nishith Pathak
Everything else Copyright © CodeProject, 1999-2008
Web16 | Advertise on the Code Project