Workflow Element (Elements)

Applies to: SharePoint Foundation 2010

Defines a workflow.

<Workflow
  Title="Text"
  Name="Text"
  CodeBesideAssembly="Text"
  CodeBesideClass="Text"
  Description="Text"
  Id="Text"
  EngineClass="Text"
  EngineAssembly="Text"
  AssociationUrl="Text"
  InstantiationUrl="Text"
  ModificationUrl="Text"
  StatusUrl="Text"
  TaskListContentTypeId="Text" >
</Workflow>

Attributes

Attribute

Description

Title

Optional Text.

Name

Required Text. Specifies the workflow name that is displayed in the SharePoint Foundation interface. The workflow name can be up to 256 characters long.

CodeBesideAssembly

Required Text. Specifies the strong name of the code beside assembly.

CodeBesideClass

Required Text. Specifies the name of the workflow class in the code-beside file used to generate the workflow assembly. This should include the namespace of the class.

Description

Optional Text. Specifies the workflow description to be displayed in the SharePoint Foundation interface. The workflow description can be up to 256 characters long.

Id

Required Text. Specifies the globally unique identifier (GUID) for the workflow.

EngineClass

Reserved for future use.

EngineAssembly

Reserved for future use.

AssociationUrl

Optional Text. Specifies the URL of the association form for this workflow. Set the value of the AssociationURL attribute to the custom form page you want to use for workflow association. For example:

AssociationURL = "MyWkflAssociationPage.aspx"
NoteNote
SharePoint Foundation supports absolute or server-relative paths in the workflow template definition. All form path URLs must be expressed in one of these formats. For example, an absolute path, such as "http://site/library/page.aspx"; or a server-relative path, such as "/layouts/page.aspx". SharePoint Foundation does not support link fix-up in workflow template definitions.

To use the same form for instantiation and association of the workflow, set both elements to that form.

For more information about association forms, see Workflow Association and Initiation Forms (Sharepoint Foundation).

InstantiationUrl

Optional Text. Specifies the URL of the initiation form for this workflow. For example:

InstantiationURL = "MyWorkflowInitiationPage.aspx"
NoteNote
SharePoint Foundation supports absolute or server-relative paths in the workflow template definition. All form path URLs must be expressed in one of these formats. For example, an absolute path, such as "http://site/library/page.aspx"; or a server-relative path, such as "/layouts/page.aspx". SharePoint Foundation does not support link fix-up in workflow template definitions.

For more information about initiation forms, see Workflow Association and Initiation Forms (Sharepoint Foundation).

ModificationUrl

Optional Text. Specifies the URL of the form handling the modifications for this workflow. If your workflow includes multiple modifications, you can program the form you specify with this attribute to:

  • Display a different view of the form, based on the modification identifier passed to this form.

  • Redirect to a separate form, based on the modification identifier passed to this form.

For more information about modification forms, see Workflow Modification Forms (SharePoint Foundation).

StatusUrl

Obsolete. Do not use.

TaskListContentTypeId

Optional Text. Specifies the content type ID of the content type assigned to the workflow task list.

For more information about task forms, see Workflow Task Forms (SharePoint Foundation).

Child Elements

AssociationData Element (Workflow)

MetaData Element (Workflow)

Categories Element (Workflow)

Parent Elements

Elements Element (Workflow)

Remarks

For more information about association and initiation forms, see Workflow Association and Initiation Forms (Sharepoint Foundation).

Example

Following is an example of the Workflow element in a workflow definition elements file. The example has been edited for clarity.

<?xml version="1.0" encoding="utf-8" ?> 
<Elements xmlns="https://schemas.microsoft.com/sharepoint/">
  <Workflow
        Name="AdventureWorksWorkflow"
        Description="Use this workflow to track sequential tasks of users."
        Id="C6964BFF-BG8D-41ac-AC5E-B61EC111731C"
        CodeBesideClass="AdventureWorks.Workflow1"
        CodeBesideAssembly="AdventureWorks, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e3bce121e9429c"
        TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160"
        AssociationUrl="_layouts/myAssocPage.aspx"
        InstantiationUrl="_layouts/myIniPage.aspx"
        ModificationUrl="_layouts/myModPage.aspx">
    <Categories/>
    <AssociationData>
      …
    </AssociationData>
    <MetaData>
      …
    </MetaData>
  </Workflow>
</Elements>

See Also

Concepts

Workflow Deployment Using Features

Workflow Definitions

Workflow Association and Initiation Forms (Sharepoint Foundation)

Workflow Modification Forms (SharePoint Foundation)

Workflow Task Forms (SharePoint Foundation)

Other Resources

Workflows in SharePoint Foundation