- A good introduction from the MSDN : Walkthrough: Define a Custom Workflow to Deploy a Database from Team Foundation Build (July 2010).
This shows you how to create an InvokeProcess activity (from the Team Foundation Build Activities Toolbar)
- An exhaustive documentation on how to extend TFS si given in the MSDN here : http://msdn.microsoft.com/en-us/library/bb130146.aspx
- Update : The complete documentation on "Team Foundation Build Activities" is available (dec 2010) http://msdn.microsoft.com/en-us/library/gg265783.aspx
- Update : A step-by-step exemple on how to implement a Custum Workflow : http://blogs.developpeur.org/tom/archive/2009/11/19/tfs-2010-d-velopper-sa-propre-activit-de-processus-de-build.aspx
Based on the previous introduction, you'll be able to work with WF 4.0 on your Build process template (more than 600 lines of XAML).
2.a. Add a new Invoke Process after a successful Build, within the "Try Compile, Test, and Associate Changesets and WorkItems" activity, inside the "Compile, Test, and Associate" sequence :
2.b. Then, Drag & Drop an Invoke Process activity (from the Team Foundation Build Activities Toolbar), click property to set its parameters.
Warning 1: The previous MSDN documentation forgot to mention to add the FileName parameter inside double quotes, this bits of code will be considered as a String by WF4).
Warning 2: You will have a red exclamation mark above each new activity in error. This is NORMAL, since once you Drop them, they are not yet configured. A mouse over it will detail the problem.
2.c. Then, add 2 sub-tasks as 2 other activities within the Invoke Process : The WriteBuildMessage and the WriteBuildError. And set them up according to the previous MSDN example.
This is only a example where you could drop your 'Invoke process' activity. On 'real' project, you should combine this with If-Then conditions, and add it on anywhere is required. For this test, I placed this new activity at the begging of your workflow to see quickly of if works. Once OK, just Drag & Drop it to a relevant place.
Update : For more details, check my other post : Variables available for workflow foundation within TFS 2010
2.d. Once done, all the red exclamation marks will disapear.
2.e. Don't forget to archive this new Build ProcessTemplate, and reference it in the Build Definition (otherwise TFS will not find your changes that are only local).
If you made an error, here is an example of a Build compilation problem (UNC=universal naming convention):
- CMD.EXE was started with the above path as the current directory.
- UNC paths are not supported. Defaulting to Windows directory.
- Access is denied.
In the resulting XAML, we can notice that Visual Basic is NOT dead :