Export (0) Print
Expand All

Workflow deployment process (SharePoint Foundation 2010)

 

Applies to: SharePoint Foundation 2010

Topic Last Modified: 2011-09-17

After you prepare a workflow for use in Microsoft SharePoint Foundation 2010, deployment of the workflow varies depending on whether you use a predefined workflow, a Microsoft Office SharePoint Designer workflow, or a Microsoft Visual Studio custom workflow.

This article contains information and procedures about how to deploy workflows in SharePoint Foundation 2010.

In this article:

SharePoint Foundation 2010 provides a single predefined workflow template, for the Three-state workflow. You can use the Three-state workflow template to create individual workflows to run in SharePoint sites. You can also use Office SharePoint Designer to define your own workflows, or you can use Visual Studio to create code-based custom workflows. Workflows are built on Windows Workflow Foundation and run in SharePoint sites, as follows:

  • SharePoint Foundation 2010: Used to host workflows. After a workflow is deployed to the host, you can activate, configure, start, participate in, and track the workflow.

  • SharePoint Designer 2010: Used to create user-defined workflows.

  • Microsoft Visio 2010: Used together with SharePoint Designer 2010 to create user-defined workflows.

  • Visual Studio: Used by developers to create workflows.

Before you perform the deployment procedures in this article, confirm that the server is running SharePoint Foundation 2010.

The predefined Three-state workflow is already installed as a SharePoint Feature in SharePoint Foundation 2010.

Workflows on a SharePoint Web site are stored as workflow templates. As an alternative to using the predefined workflow, you can create SharePoint workflow templates in Office SharePoint Designer and Visual Studio, and then deploy them to a SharePoint Foundation 2010 Web site. Use SharePoint administration tools as needed to add the template to libraries or lists on a SharePoint Foundation 2010 Web site.

To deploy a predefined workflow, you activate it for the site, associate it with a list, library, content type, or site, and then start the workflow.

To deploy workflows in SharePoint Foundation 2010, use the appropriate procedure from the following:

Activate the workflow

As described earlier in this article, before you can use a predefined workflow, it must be active in the site or site collection. Only active workflows can be associated with the lists and libraries on the site or site collection.

The predefined Three-state workflow is active by default when a site or site collection is created. Because the workflow can be deactivated, you can check the site or site collection to determine whether the Three-state workflow is active. Use the following procedure to determine whether the Three-state defined workflow is active, and then activate it as necessary.

To activate a workflow that is deployed as a feature, such as the predefined Three-state workflow, see Activate or deactivate a workflow (SharePoint Foundation 2010).

Add the workflow association to a list, library, content type, or site

When you add a workflow, you associate the workflow with a list, library, content type, or site. You configure the workflow by specifying parameters such as the workflow name, start options, participants, and completion options.

To add a workflow association, see Add a workflow association (SharePoint Foundation 2010).

Start the workflow

After you activate a workflow and add it to a list, library, content type, or site, an authenticated user can run the workflow on an item in the list, on a document in the library, or on a site in the case of a site workflow. When you add the workflow, you specify whether you want the workflow to run automatically or manually. If the workflow is configured to start automatically, the default settings are always used when the workflow begins. If the workflow is configured to start manually, a user can modify the default settings, such as specifying workflow participants and specifying a due date. The workflow runs on items in the list or documents in the library with which the workflow is associated.

The procedure for starting a workflow depends on whether it was configured to start manually or automatically.

For more information, see Start a workflow instance (SharePoint Foundation 2010).

When user-defined workflows are enabled, users can deploy Office SharePoint Designer workflows on their sites.

Enable user-defined workflows

To allow users to create and run SharePoint Designer 2010 workflows, you must ensure that user-defined workflows are enabled for the site collection. By default, this setting is enabled. When this setting is enabled, users can define workflows in a declarative workflow editor such as the SharePoint Designer 2010 workflow editor. A declarative workflow is a workflow that is built from conditions and actions that are assembled into rules and steps, and that sets the parameters for the workflow without writing code. Unlike code-centric workflows such as those that are created by using Visual Studio, declarative workflows are not deployed to SharePoint Foundation 2010 as compiled code. Instead they are compiled at runtime.

Because the capability to use declarative workflows on the Web application can be turned off, you can check the Web application to determine whether declarative workflows are active.

For information, see Enable or disable declarative workflows (SharePoint Foundation 2010).

Create a SharePoint Designer workflow

By using the Workflow Designer wizard in SharePoint Designer 2010, you can create workflows that add application logic to the site or site collection without writing custom code. The Workflow Designer incorporates the tasks of creating the workflow, activating the workflow, and adding it to the list, library, or site. You do not have to perform any manual configuration tasks outside the designer to deploy the workflow. However, if you publish a workflow template to a SharePoint site collection, you can download that template as a WSP file and then deploy it to other site collections. For more information, see Deploy a workflow as a WSP file (SharePoint Foundation 2010).

Start the workflow

Because SharePoint Designer 2010 can automatically activate the workflow and add it to a list, library, or site, an authenticated user can then run the workflow on an item in the list, on a document in the library, or on a site in the case of a site workflow. When you create the workflow in SharePoint Designer 2010, you specify whether you want the workflow to run automatically or manually. If the workflow is configured to start automatically, the default settings are always used when the workflow begins. If the workflow is configured to start manually, a user can modify the default settings, such as specifying workflow participants and specifying a due date, as allowed by the workflow template. When started, the workflow runs on items in the list, on documents in the library, or on the site with which the workflow is associated.

For more information, see Start a workflow instance (SharePoint Foundation 2010).

After a Visual Studio custom workflow is created and installed, the processing to deploy it resembles that of a predefined workflow.

Create a custom workflow

When a custom workflow is created by using Visual Studio, it is packaged as a SharePoint Feature. Feature packaging is a way of encapsulating SharePoint solutions and functionality for ease of deployment. After the development team has created a workflow and packaged it as a Feature, deploy the workflow using the Install-SPFeature Windows PowerShell command as described in the following section.

Install the custom workflow

You install Features in the \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features directory. Each Feature in its own subdirectory. At the root of this folder, a Feature.xml file defines the contents of the Feature. Use the Windows PowerShell Install-SPFeature cmdlet to install the Feature. For details, see Install-SPFeature.

importantImportant
To run Windows PowerShell, you must be a member of the Administrators group on the local computer. Also, Windows PowerShell must be enabled as a feature on the server on which you are installing a workflow.

Activate the workflow

Before you can use a Visual Studio workflow that was deployed as a feature, you must activate it for the site collection. Only active workflows can be associated with the lists, libraries, content types, and sites.

To activate a workflow that is deployed as a feature, see Activate or deactivate a workflow (SharePoint Foundation 2010).

Add the workflow to a list, library, content type, or site

When you add a workflow, you associate the workflow with a list, library, content type, or site, and you configure the workflow by specifying parameters such as the workflow name, start options, participants, and completion options.

To add a workflow association, see Add a workflow association (SharePoint Foundation 2010).

Start the workflow

After you activate a workflow and add it to a list, library, content type, or site, an authenticated user can run the workflow on an item in the list or a document in the library or in the case of a site workflow, on a site. When you add the workflow, you specify whether you want the workflow to run automatically or manually. If the workflow is configured to start automatically, the default settings are always used when the workflow begins. If the workflow is configured to start manually, the user can modify the default settings, such as specifying workflow participants and specifying a due date. The workflow runs on items in the list or documents in the library with which the workflow is associated.

The procedure for starting a workflow depends on whether it was configured to start manually or automatically. For more information, see Start a workflow instance (SharePoint Foundation 2010).

After you deploy a workflow, we recommend that you test the workflow to ensure that it is functioning correctly, sending e-mail notifications to the correct workflow participants at the correct stages in the workflow, and delivering the expected results.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft