Udostępnij za pośrednictwem


How to: Create a SharePoint Workflow Project

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • SharePoint workflow

Microsoft Office version

  • SharePoint Server 2007

For more information, see Features Available by Application and Project Type.

You can design custom workflow templates to manage the life cycle of documents and list items in a SharePoint Web site. To design a custom workflow template, create a SharePoint sequential or state machine workflow project.

To create a SharePoint workflow project

  1. In the New Project dialog box, in the Project types pane, expand Visual Basic or Visual C# and select one of the following nodes (all of them contain the same workflow project templates):

    • Workflow.

    • Office.

    • The 2007 child node of the Office node.

  2. Select either the SharePoint 2007 Sequential Workflow template or the SharePoint 2007 State Machine Workflow template, type a name, and then click OK. For information about each type of workflow, see SharePoint Workflow Solutions.

    The New Office SharePoint Workflow wizard appears. Use this wizard to specify debug configuration settings. The Visual Studio Tools for Office workflow deployment process applies these settings when you debug the workflow template from Visual Studio.

  3. In the Specify the workflow name and site for debugging page, type the name that you want to use to identify the workflow template on the SharePoint Server Web site.

  4. Type or select the URL of the SharePoint Web site that you want to use to run this workflow. This site must be on the local computer.

    Note

    You must have administrator access to the SharePoint Web site.

    By default, the New Office SharePoint Workflow wizard uses https://localhost/Docs. This might not be a valid URL on your root SharePoint Server Web site.

  5. Click Next.

    If the SharePoint Web site does not contain a history list, the New Office SharePoint Workflow wizard creates one automatically. A history list is a log that records the events of the workflow—for example, when a workflow starts or a task is created or completed.

    Note

    If the New Office SharePoint Workflow wizard is unable to create a history list on the SharePoint Web site, you will receive an error. To resolve the error, you must manually create a history list on the SharePoint Web site. For more information about how to do this, see the Office Online article Add or change a workflow for a list, library, or content type.

  6. In the Select the lists you will use when debugging page, set Library or list to the library or list on the SharePoint Web site that you will use to initiate the workflow.

    For example, if your workflow is designed to track a document review process, specify a document library.

  7. Select the Automatically Associate Workflow check box, unless you want to associate the workflow with the list manually.

    Note

    If you select this option, the Visual Studio Tools for Office workflow deployment process adds the workflow template to the specified library or list when you debug the workflow template. If you clear this option, you must add the workflow template manually by using the Add a Workflow administration page in the SharePoint Web site.

  8. Set Task list to the task list that you want to use.

    The task list displays the workflow tasks that are available to each workflow participant.

  9. Set History list to the list that displays all the events that occur as the workflow is running.

    If a history list does not exist on the local SharePoint Web site, the workflow deployment process creates one.

  10. Click Next.

  11. In the You can specify the conditions for how your workflow is started page, select the workflow start conditions and then click Finish. For information about each condition, see Debugging SharePoint Workflow Solutions.

    After you finish the wizard, the Designer for Windows Workflow Foundation opens in Visual Studio. Use this designer to create a workflow schedule. For more information, see SharePoint Workflow Solutions.

See Also

Tasks

How to: Include Helper Files When you Debug a SharePoint Solution

SharePoint Sequential Workflow Sample

Walkthrough: Creating and Debugging a SharePoint Workflow Solution

Concepts

SharePoint Workflow Solutions

Debugging SharePoint Workflow Solutions

Reference

SharePoint Workflow Project Templates