共用方式為


Introduction to Workflows in SharePoint Foundation

Applies to: SharePoint Foundation 2010

A workflow allows you to attach a business process to items in Microsoft SharePoint Foundation 2010. This process can control almost any aspect of an item in SharePoint Foundation 2010, including the life cycle of that item. For example, you could create a simple workflow that routes a document to a series of users for approval.

Workflows can be as simple or complex as your business processes require. You can create workflows that the user initiates, or workflows that SharePoint Foundation 2010 automatically initiate based on some event, such as when an item is created or changed.

Using SharePoint Foundation Workflows

SharePoint Foundation 2010 workflows are made available to end-users at the list or document-library level. Workflows can be added to documents or list items. Workflow can also be added to content types. Multiple workflows may be available for a given item. Multiple workflows can run simultaneously on the same item, but only one instance of a specific workflow can run on a specific item at any given time. For example, you might have two workflows, called SpecReview and LegalReview, available for a specific content type, Specification. Although both workflows can run simultaneously on a specific item of the Specification content type, you cannot have two instances of the LegalReview workflow running on the same item at the same time.

SharePoint Workflow Technology Architecture

You can create workflows by using the Visual Studio 2010 Workflow Designer. Each workflow is compiled into its own DLL.

In addition, your workflows can interact directly with the user through custom workflow forms. Workflow forms enable you to gather information from the user at each stage of the workflow.

For information about using technologies such as Microsoft ASP.NET to create workflow forms, see Workflow Forms Overview.

To install the workflow on a server farm, you need to create a workflow definition. A workflow template definition is an XML file that contains the information SharePoint Foundation requires to instantiate and run the workflow, such as:

  • Name, GUID, and description of the workflow

  • Location of any custom forms used in this workflow

  • Correct class within the workflow assembly to call

For more information about creating a workflow definition, see Workflow Definitions.

Each server farm contains a workflow associations table. Each entry in this table contains association data for a workflow as it applies to a specific content type, list, or document library. This association data typically includes whether the workflow is started automatically or by users, and the task and history lists for the workflow. If a workflow has been added to multiple content types, lists, or document libraries, it will have one entry for each such association. Likewise, if you add multiple workflows to a specific content type, list, or document library, then the table contains one entry for each workflow added to the content type, list, or document library.

For more information about workflow association, see Workflow Stages.

The figure below illustrates the conceptual workflow architecture in SharePoint Foundation. Each content type, list, and document library in the farm is linked to the workflows added to it through the workflow association table. Each workflow has a workflow definition. This XML definition specifies the identity of the actual workflow assembly, and class within that assembly, as well as the location of any workflow forms the workflow needs to run.

Workflow association conceptual architecture

See Also

Concepts

Workflow Hosting Architecture

Workflow Object Model Overview in SharePoint Foundation

Workflow Development for SharePoint Foundation