This documentation is archived and is not being maintained.

Walkthru:Extending Process Templates 

Visual Studio 2005
Extensibility Guided Tour Send comments on this topic.
Walkthru:Extending Process Templates

Glossary Item Box

Extending Process Templates

In software development, the term Process is used to connote the way in which developers attempt to ensure quality, consistency, predictability, and timeliness of delivery by making their development efforts as close to standardized and repeatable as possible. The way in which developers chose to meet these goals, i.e. what they focus on and how, is known as methodology. Visual Studio Team System embraces the need for Process by integrating process implementation directly in to the tools developers use on a daily basis – Visual Studio. Process Templates are the mechanism in which process and methodologies are translated into concrete units of work which can then be tracked and analyzed to provide valuable metrics. These metrics can then be analyzed against the project's methodology to help ascertain project health, timeliness, and stability – which helps ensure continued success.

Team Foundation Server ships with a number of built in process templates designed to help companies implement integrated process control quickly and easily, but the expectation is that development teams and organizations will also want to customize process templates to meet their needs. Process templates, therefore, are designed to be a framework to support process – they're not designed to be a methodology or process in and of themselves. To support their extensible nature, Process Templates are defined by a simple XML Schema that allows for easy modification. With this flexible schema in place, organizations are free to fine tune existing process templates to meet their own methodology needs. Organizations are also free to implement completely custom templates to meet their needs. Visual Studio Partners are also able to tap into the inherent extensibility provided by Process Templates to cater to the needs of organizations, or to address new methodologies as they take shape within development circles.

The primary purpose of this walkthrough is to give you an overview of the way in which Team Projects are organized and created – through the exploration and modification of an existing Process Template. As such, you will export the MSF Agile Process Template, make a few modifications, and then upload the modified Process Template and use it to create a new Team Project. The modifications made will be simple, but will help provide you with a sound overview of the nature of Process Templates and their extensible nature.

To investigate Process Templates and make the changes:

1.  Ensure that you are connected to a Team Foundation Server before continuing. Open the Team Explorer by selecting the View | Team Explorer menu option. Once the Team Explorer is in view, if you don't have any Team Projects listed, click the Add Existing Team Project button to connect to a Team Foundation Server and follow the wizard to connect if needed.

2.  Once you are connected to a Team Foundation Server, select the Team | Team Foundation Server Settings | Process Template Manager menu command.

3.  In the Process Template Manager, select the MSF Agile (default) template, and click the Download button.

4.  From the Download Process Template dialog, navigate to your Desktop and click Save to export the Process Template for editing. Wait a few seconds while the export process executes (there may not be an hour-glass or any other visual clue). After a few seconds a message will report: Process Template downloaded successfully . Click OK to close the notification. Close the Process Template Manager window.

5.  On your Desktop, locate the MSF for Agile Software Development folder (where the default Process Template was exported.)

6.  Right-click the MSF for Agile Software Development folder and select Properties. Uncheck the Read-only attribute. Click OK, and then click OK again.

7.  Rename the MSF for Agile Software Development folder to "MyProcessTemplate".

8.  Double click the MyProcessTemplate folder to open it.

9.  Right click on ProcessTemplate.xml and select Edit (if you don't have an Edit option, select Open With, and select Visual Studio).

ProcessTemplate.xml serves as the primary point of definition for a Process Template. Within the file are directives which instruct Team Foundation Server which Plug-ins to load (i.e. which components – such as source control, work items, reporting, etc.), and where to find corresponding files and resources describing the nature of the content provided by the Plug-in. Additional directives instruct TFS how these Plug-ins interact with the Project Creation process (i.e. whether or not each Plug-in will integrate with the Process Creation Wizard (PCW), as well as <group> instructions detailing dependencies and other key points of interactions between the Plug-ins and TFS.

10.  In ProcessTemplate.xml , locate the <name> element, and change the contents to "My Custom Process Template". Then locate the <description> element and change its contents to: "Sample Custom Process Template."

11.  Take a few seconds to look at the various definitions and relationships in the file. (Plug-in definitions are near the top of the file, while their interactions are defined in group entries down below.)

12.  Look at the first <plugin> element/entry. This directive corresponds to the Classification Plug-in which helps define the scope and structure of a Team Project. Note that the first <group> entry corresponds to Classification, and that there are no dependencies required for this Plug-in to be used during the creation of a Team Project (though many other Plug-ins depend upon it). There are, however, tasks associated with this Plug-in which will be run during the creation of a new Team Project based on this Process Template. Rather than placing the associated tasks into the <taskList> node in this file, the tasks have been placed in an external file – linked by the filename attribute. This is in accordance with Process Template convention which favors placing tasks and related resources for each Plug-in in to separate folders within the Process Template root folder.

13.  Save your changes to ProcessTemplate.xml and close the file. In Windows Explorer open the Classification folder, and then open the Classification.xml file for editing. This file corresponds to the filename attribute provided in the <group> definition for the Classification Plug-in in ProcessTemplate.xml.

The Classification.xml file contains directives for schema that will be associated by default with each newly created project using this Template. Schema refers to information about the structure of the project, as well as information about the number of planned iterations, or key periods of development, that will be considered for a given Team Project. Changes made to the files in this directory will be propagated out to each project that derives from this Process Template.

14.  Locate the <Children> node of the first <Node> element (with a StructureType of ProjectLifeCycle ). Within this node are three children – used for Agile Methodology Iterations through a project. Change the Name attributes of the "Iteration #" nodes to "Proof of Concept", "Base Functionality" and "Remaining Features".

Note the second <Node> listed in the <Nodes> collection. If your Team Projects always had, for example, a Back-End, Front-end, DAL, BLL, etc. you could create those Areas within the schema for this Process Template. Then any Team Projects Created with this Process Template would inherit those areas as part of their schema.

15.  Save your changes to Classification.xml and close the file.

16.  Return to the MyProcessTemplate folder on your Desktop. Note that there is a specialized folder for each Plug-in. Within each are taskLists and any supporting resources.

17.  Open the WorkItem Tracking folder, for example, and then open the workitems.xml file for editing. A list of tasks is located in the workitems.xml file – but definitions for different types of Work Items are found in the TypeDefinitions folder, and definitions for queries are located in the Queries folder.

Each Team Project tracks the actual implementation of work and effort through the use of Work Items. Each Process Template defines the types of Work Items that will be used in a given Team Project and the definitions for those Work Item Types are found in the WorkItem Tracking folder. Definitions for the default queries, used to evaluate the progress of Work Items, are also found in this directory. All definitions adhere to specialized schemas designed with flexibility and extension in mind.

18.  Open the TypeDefintions folder and open some of the Work Item definitions available. To add a new Work Item definition to a Process Template, you just need to create a new definition, drop it into the TypeDefinitions (or another) folder, and then direct the WorkItemTracking Plug-in to load the custom Work Item Type by providing a <WORKITEMTYPE> definition with a file location in the workitems.xml file – in this way you get all the benefits of strong integration with Visual Studio and the ease of a declarative model.

19.  Take a few seconds to look at the contents of the workitems.xml file – note that the top of the file defines which kinds of Work Items are to be included in the Process Template, and that the second part of the file actually creates default Work Items (by populating their types and values) which will accompany any newly created Team Project created with this Process Template.

20.  Delete all <WI> elements in the <WORKITEMS> node except for the first, or top, one. Then change the value attribute for the second <FIELD> (refname="System.IterationPath") to "PROJECTNAME\Proof of Concept" to make it correspond with the changed iteration names specified in classification.xml . (In a non-sample scenario many more work items would be created initially – all mapped as needed.)

21.  Save your changes and close workitems.xml.

22.  Return to Visual Studio, and select the Team | Team Foundation Server Settings | Process Template Manager menu option. Then press Upload to begin importing your custom Process Template to the Team Foundation Server.

23.  From the Upload Process Template dialog, locate the MyProcessTemplate folder on your Desktop and press Upload.

24.  After a few seconds, you will see a dialog that reports: Process Template uploaded successfully. Click OK, then click Close to close the Process Template Manager.

25.  Select the File | New | Team Project menu option to begin creating a new Team Project with your custom Process Template.

26.  Specify "MyTestProject" for the name of the Team Project once the Project Creation Wizard loads, then click Next to continue.

27.  From the Select a Process Template page of the Wizard, specify My Custom Process Template and then click Finish.

As the new project is created, the values in the Status label will be updated with the text supplied from description and completionMessage attributes from the various <group> definitions found in ProcessTemplate.xml.

28.  Once the Team Project is created, open the MyTestProject | Work Items | Team Queries | All Work Items node and double click on the All Work Items node to view the work item created via the Process Template.

29.  In the main editor pane, locate the Classification section of the Work Item, and select the drop down – note how the available iterations correspond to the values that you placed in Classification.xml.

Had you added Areas to the file, they would show up in the Area dropdown as part of the project's schema. Likewise, had you specified custom Work Item Types, they would be available for creation as well. To learn how to modify and extend work items, please continue on to the next Walkthrough.