Basic workflow knowledge

Source: Internet
Author: User

1Workflow development overview

SharePoint builds its workflow functions based on Windows Workflow Foundation. WF is the basis of the SharePoint workflow framework. To have a deep understanding of SharePoint workflow development, we should first understand some basic knowledge of WF. This chapter will not explain the technical details of WF too much. This section describes the basic knowledge of SharePoint workflows and introduces the use of built-in workflow templates and default workflow task operations.

2Building a workflow development environment

If you are using Visual Studio 2005 to develop a Sharepoint workflow application, you first need to install the WF extension of Visual Studio 2005 -- Visual Studio 2005 extensions for Windows Workflow Foundation, which can be downloaded at: http://www.microsoft.com/downloads/details.aspx? Familyid = 5d61409e-1fa3-48cf-8023-e8f38e709ba6 & displaylang = ZH-CN. Then install the Office Sharepoint Server 2007 SDK.

Using Visual Studio 2005 to develop SharePoint workflows makes it cumbersome to build development environments or debug and test them during development. Visual Studio 2008 has been officially released. vs 2008 provides better support for Sharepoint workflow development and integrates development, deployment, and debugging. This chapter uses the vs 2008 example.

To facilitate debugging and test workflows, you can select to develop them directly in the Sharepoint Server environment. Therefore, vs 2008 must be directly installed on the Sharepoint Server.

3 SharePointBasic concept of Workflow

A SharePoint workflow is a pre-defined process for handling list items or document library documents. A workflow instance is associated with a list item or document. A workflow instance cannot be separated from the list item. When a user needs to process data, for example, for approval, the system will create a task in a task list and approve the tasks in the user operation list to interact with the process instance.

Workflow instances can be automatically started when the list is created or modified, or manually started by users. Moss supports two workflow development methods.

IExploitationSharePoint designerEasy to designCodeSequential workflow.

In SharePoint designer, you can directly create a workflow associated with a list or document library. In a workflow, you can directly access the fields of list items, obtain the field value for logical judgment or assign a value to the field, assign the approval task to the user, and dynamically generate the approval page. A workflow designed by Sharepoint designer can be associated with only one list (or document library). A single workflow cannot be used for multiple lists. The workflow processing logic of different lists (or document libraries) is the same, you can only design them separately.

The workflow design using SharePoint designer has the advantages of being easy to operate without compilation and deployment. The disadvantage is that it can only implement sequential operation logic, but cannot implement loop logic such as return. The approval interface is automatically generated, and cannot implement some complex operations. Section 7.2 describes how to design a workflow using SharePoint designer.

IIExploitationVisual StudioComplex sequence or state machine workflows can be developed.

In Visual Studio 2008, you can develop a workflow directly in the WF designer. After the workflow is developed, it is compiled into a DLL and then deployed to the Sharepoint Server using feature. After the feature is activated on the website, A workflow can be used to associate a workflow with multiple lists. Therefore, the workflow designed by Visual Studio 2008 is a workflow template.

Visual Studio 2008 develops a workflow to implement complicated process logic. The developed workflow template can be used by multiple websites and lists. You can use infopath or aspx pages to perform complex page operations. The disadvantage is that the development and deployment are complex and have high requirements on developers.

4 SharePointWorkflow Operation Method

The default operation method of SharePoint workflows is not suitable for users' operation habits. Generally, the operation method of other workflow products is to complete all operations on one page, including viewing business data (Approved data) and enter the approval comments. The SharePoint workflow is operated by separating business data from approval data. business data can be represented by list items or documents in the document library. By default, only the approval page is displayed during user approval, you can only click a link to view the business data. This method is still applicable to document approval, but the approval of List data is somewhat "not user-friendly. In actual projects, you need to guide your operation habits.

By default, Sharepoint provides many workflow templates, which are the same as those developed in vs 2008. Next, let's take a look at the use of the system's built-in "approval" workflow template. To use a workflow template in Sharepoint, you must first associate the workflow template with the document library or list. The procedure is as follows.

Step 1On the settings page of the document library, click"Workflow settings"Link,1.


Figure1Workflow settings

Step 2: On the Add workflow page, select "approval" as the workflow template, enter the workflow name as "Document approval", and click "Next", as shown in figure 2.


Figure2Add Workflow

Step 3 On the workflow parameter settings page, select the task allocation object " Serial " , Enter two users as approvers, and select " Document rejected " Cancel workflow, select " After the workflow is completed " Is " Update approval status " , 3 . Click " OK " Button to complete the settings.


Figure3Set workflow Parameters

Step 4To facilitate the approval of user operations, you needWebpartAdd to the homepage of the website,4.


Figure4Add User taskWebpart

The workflow configuration has been completed. Let's take a look at the use of this workflow.

Step 1Create or upload a document in the document library, and then select"Workflow"Option,5.


Figure5Select"Workflow"Option

Step 2 click "Document approval" workflow, as shown in figure 6.


Figure6Select Workflow

Step 3On the configuration approval parameters page, enter the approval information,7. Click"Start"Button.


Figure7Configuration approval Parameters

Now that the document approval workflow has been started, return to the document library page and you will see an additional document library"Document approval"Column,8. Pass"Document approval"Links in the bar can be linked to the workflow monitoring and management page,9. On the workflow monitoring and management page, you can view the assignment and completion of a workflow task and forcibly terminate the workflow.


Figure8Workflow links in the Document Library


Figure9Workflow monitoring page

Log on to the system with the account of the first approved user. You can view the task to be operated in the user task Web component, as shown in figure 10.


Figure10Workflow task

Click the task link. On the subsequent task operations page, you can view the approved documents through the link and click the "approve" and "reject" buttons below for approval, as shown in 11.


Figure11Task page

User ID2To log on to the system and perform approval. After both approvers approve the document, return to the document library page and you can see that the document approval status has changed"Approved",12.


Figure12Document Library

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.