Skip to main content

Cloud

Visual Studio 2008 and SharePoint Workflows

As you probably heard by now, VS 2008, out of the box, comes with templates for creating SharePoint workflows.

The wizard will ask you give the workflow a name and tell it what local site you want to use for debugging it.

Next the wizard will ask you if you want to automatically associate the workflow with a library, a history list and a task list. To take advantage of the deployment feature of VS 2008 you should do this.

The wizard next question is how the workflow can be started. For development, I usually check “Manually by User” and “When an item is created”.

Once the wizard creates your project, you will see that it has created a feature.xml, a workflow.xml and it has signed the project. If you open the two xml files you will see that they are actually populated unlike the VS 2005 templates where you had to populate those.

One thing that I like to do is rename the class created by the wizard from its default name (Workflow1.cs) to something more project related. I’m going to rename it to “Demo”.

There are a couple of manual things you must do when you rename your class. First you have to modify the workflow.xml. You need to change the CodeBehindClass attribute to contain the right name. In our case it will be “DemoWorkflow.Demo”.

The next piece you have to change seems to be a bug in VS2008. When you change the name of the class, the “activitybindname” in the designer.cs class are not changed. You have to change those manually. Because of this little quirk is better to change the class name as soon as you get started or you will be changing many activitybindnames.

Happy Designing…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Oscar Meszar

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram