Dela via


Customizing Global Workflow

You define a global workflow when you want to maintain a set of work item fields that multiple types of work items share. If you use a global workflow, you can define fields and global lists that are available to all work item types in either a team project or a team project collection.

Note

Before you can define a global workflow, the feature must be enabled on the application-tier server. Therefore, the server must be running a version of Visual Studio Team Foundation Server, such as Team Foundation Server 2010 with Service Pack 1 (SP1), that supports this feature. You can obtain the service pack at the following page on the Microsoft website: Service Pack 1 of Visual Studio Team Foundation Server 2010, Beta.

In this topic

  • Contents of a Global Workflow

  • Defining and Managing Global Workflow

  • Example Global Workflow XML File

Contents of a Global Workflow

You can define a global workflow in a similar way that you customize a work item type. To customize or create a global workflow, you define or modify a n XML file.

Note

No global workflows are defined for any Microsoft Solutions Framework (MSF) process templates. However, if you install the appropriate Feature Pack, a global workflow is imported to the team project collections that you configure to participate in data synchronization. For more information, see Microsoft Team Foundation Server 2010 and Microsoft Project Server Integration Feature Pack.

A global workflow can contain the following elements:

  • FIELD (Definition). You can specify the definitions for fields and all qualifying and conditional rules for each field. These rules are contained within a FIELDS parent element.

  • GLOBALLIST. You can specify one or more global lists as part of the global workflow. These lists are contained within a GLOBALLISTS parent element.

If you specify a field that is not currently defined for the team project or the collection, the field is created when the global workflow is imported. You cannot change the properties of fields that have already been defined for a type of work item. For example, you cannot change the attributes that are associated with the friendly name, the reference name, or reporting by modifying the global workflow.

A global workflow cannot contain the following elements and definitions:

  • HELPTEXT. You cannot specify help text for a field.

  • WORKFLOW. You cannot specify a workflow that consists of states, transitions, and reasons. Workflow is always scoped to a type of work item.

  • FORM. You cannot specify the layout of the work item form because it is always scoped to a type of work item.

Global workflow elements belong to the https://schemas.microsoft.com/VisualStudio/2008/workitemtracking/globalworkflow namespace.

Back to top

Defining and Managing Global Workflow

Task

Topic

Look up the syntax of a global workflow element. You define global workflow by using the FIELD (Definition) and GLOBALLIST elements and their child elements.

Global Workflow XML Element Reference

Create, modify, export, or import a global workflow. You manage global workflow by using the following commands in the witadmin command-line tool:

  • exportglobalworkflow:  Exports the XML file that define a global workflow.

  • importglobalworkflow:  Imports the XML file that defines a global workflow.

Managing Global Workflow [witadmin]

Back to top

Example Global Workflow XML File

The following example shows how you can define two fields within the global workflow by using the FIELD (Definition) element and its supported rule elements. For more information, see All FIELD XML Elements Reference.

<?xml version="1.0" encoding="utf-8"?>
<GLOBALWORKFLOW>
   <FIELDS>
      <FIELD name="Project Server Enterprise Project" refname="Microsoft.Sync.ProjSrv.ProjectName" type="String">
         <ALLOWEDVALUES not="[global]\Project Collection Service Accounts" expanditems="false">
            <LISTITEM value="PsProject" />
         </ALLOWEDVALUES>
         <DEFAULT not="[global]\Project Collection Service Accounts" from="value" value="PsProject" />
      </FIELD>
      <FIELD name="Project Server Requested Project GUID" refname="Microsoft.Sync.ProjSrv.RequestedProjGuid" type="GUID">
         <ALLOWEDVALUES not="[global]\Project Collection Service Accounts" expanditems="false">
            <LISTITEM value="3aabbaa9-f204-4748-897c-47904155bc61" />
         </ALLOWEDVALUES>
         <DEFAULT not="[global]\Project Collection Service Accounts" from="value" value="3aabbaa9-f204-4748-897c-47904155bc61" />
         <WHEN field="Microsoft.Sync.ProjSrv.ProjectName" value="PsProject">
            <ALLOWEDVALUES not="[global]\Project Collection Service Accounts" expanditems="false">
               <LISTITEM value="3aabbaa9-f204-4748-897c-47904155bc61" />
            </ALLOWEDVALUES>
            <COPY from="value" value="3aabbaa9-f204-4748-897c-47904155bc61" />
         </WHEN>
      </FIELD>
   </FIELDS>
</GLOBALWORKFLOW>

Back to top

See Also

Concepts

All FIELD XML Elements Reference