Workflow Deployment Using Features
Last modified: April 16, 2010
Applies to: SharePoint Foundation 2010
To discuss deploying workflow solutions involves addressing the means by which most functionality is deployed in Microsoft SharePoint Foundation 2010—Features.
Feature packaging is a way of encapsulating SharePoint Foundation 2010 solutions and functionality for ease of deployment. It provides a mechanism by which developers can package the files needed for a solution, such as workflows, Web Parts, lists, and site definitions, for ease of distribution and deployment. Developers package the necessary files into a .wsp file, which is essentially a .cab file containing a manifest that lists its contents.
Use the feature packaging deployment mechanism included in SharePoint Foundation to deploy your custom workflow solutions.
For example, suppose you created a Software Specification Review workflow solution. The feature package for this solution might include:
A feature.xml file, which is the manifest that contains references to the various objects packaged in the feature.
Compiled workflow assembly itself.
Any custom forms needed for the workflow.
Workflow template definition file.
As mentioned, the feature.xml file contains references to all the element manifests within that feature. Workflow template definitions are element manifests.
For more information about creating workflow definition XML files, see Workflow Definitions.
For more information about using Features to package and deploy SharePoint Foundation solutions, see Using Features in SharePoint Foundation.
Workflow Feature Example
Following is a sample feature.xml file that defines a workflow Feature. Notice that the feature.xml file references the workflow.xml file, which contains the workflow template definitions for this workflow solution.
The file path reference is relative to the installation location of the feature, which for a specified feature is always setupRoot\12\template\features\featureName.
<Feature Id="GUID" Title="Default Title" Description="This feature is a workflow that ..." Version="126.96.36.199" Scope="Site" xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests> <ElementManifest Location="workflow.xml" /> </ElementManifests> <Properties> <Property Key="GloballyAvailable" Value="true" /> </Properties> </Feature>