In this post we will discuss how to create a sequential workflow using Visual Studio 2010 in SharePoint 2010.
Also you can read some SharePoint online tutorials:
– Download FREE PDF on HUB site in SharePoint online
– Apply html to email template in SharePoint 2010 designer workflow
– Reusable Approval workflow in SharePoint designer 2010
Follow below steps to create the sequential workflow:
1. Create New Project using visual studio 2010.
2. In the New Project dialog box, Select the SharePoint and then select the 2010.
3. Now select the Sequential Workflow Template.
4. Enter the name of Workflow and then click ok. See in fig
5. Now enter the site url that you want to use it for debugging.
6. Select Deploy as a farm solution and then click Next.
7. Now leave the name of workflow and select the List Workflow. See in fig
8. Click on Next
9. Now select the list or library to associate your workflow. See in fig
10. Specify the conditions for how your workflow should be started. See in fig.
11. Click on Finish.
12. See the following code for Workflow1.cs
public sealed partial class Workflow1 : SequentialWorkflowActivity
public Guid workflowId = default(System.Guid);
public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
13. And see the onWorkflowActivated1 properties. See in fig
14. Now Save the solution and click on Deploy.
15. Now Open your SharePoint site and go to custom list to which the workflow is associated by you.
16. Create a new item and you could be able to see a new column name which shows the status of workflow. See in fig.
17. In this project I have not added any activity so the workflow status will show completed.