How to create workflow in SharePoint2010 using visual studio
In this post, I will show you how to create a simple sequential workflow using visual studio. You can download a complete solution here.
1. Open visual studio and under SharePoint2010 project template select Sequential Workflow
2. Type your site collection Url and client Next, note that you can only deploy this workflow as farm solution.
3. Give a proper name for you workflow.
4.Associate this workflow with a list or library, in my case I associate it with a custom list called Test.
5. Configure whether workflow triggers , you can choose start manually or automatically when item is created or modified.
6. Drag a log to history activity to the workflow designer pane as shown below.
7. Configure the activity by going to the properties panel and type “workflow hello world” in the HistoryDescription
8. Deploy your solution and we can have test drive as below.
a. Navigate to the test list and add a new item
b. After you click the save button , you will see the workflow is running.
c. Since this is a very simple workflow , after you refresh the browser you can see the workflow status changed from In Progress to Completed.
d. If you click the Completed link , you will your Workflow Hello World in that page.