Hello guys,
In this article we will work on developing sequential workflow in SharePoint 2010 using Visual studio 2010.
let start creating new project of type Sequential Workflow ,under SharePoint 2010 in Visual studio 2010.
Deploy as form Solution. Click Next
Name workflow as devendra Sequential -workflow and select site workflow.
click on Next
CLick Next.
CLick Next.
Click on Finish.
It will show the below project structure.
Go to tool box. Select Create Task under SharePoint workflow
Drag and drop below onworkflowActivated .
Click on the redmark in Createtask1 control
Click on Activity ‘createTask1’ does not have Correlation property set.
Give the Correlation token as Task token.
Select Owner ActivityName as Workflow1.
Click on TaskProperties.Select Bind to new member.
Select create Field. Click OK.
Go to workflow.cs[design] > right click > View Code
It will redirect to the code file workflow.cs file you can see the filed you have added just now.
If you check the Bind to existing member you can the Field added it.
Click on TaskID from the properties of CreateTask activity. Select Bind to new member.
Select create Field. Click Ok.
Go to workflow.cs[desgin]right click View Code
It will redirect to the code file workflow.cs file you can see the filed you have added just now.
Go to Workflow1.cs-Desgin.
Double click on Create Task Activity.It will generate a method called createTask1_MethodInvoking.
Write the below code in the method.
private void createTask1_MethodInvoking(object sender, EventArgs e) { createTask1_TaskId1 = Guid.NewGuid(); createTask1_TaskProperties1.Title = "New Task"; createTask1_TaskProperties1.Description = "Please complete this ASAP"; createTask1_TaskProperties1.AssignedTo = workflowProperties.Originator; }
The above code create the task for user we runs the workflow.
Go to ToolBox select LogtoHistoryListActivity under Sharepoint workflow
Drag and drop the LogtoHistoryListActivity to workflow.cs[design] file below create task
Click on logToHistoryActivity1 Press F4 to see the properties.
Click on History Description.
SharePoint-Journey for Administrators, Developers and users
No comments:
Post a Comment