Search code examples
.nettfsworkflow-foundationbuild-process-template

Accessing PendingChanges on a custom CodeActivity on TFS


I have a scenario where I have a gated check-in that targets a custom build process template.

I want to have a set of validations that are performed on the files that is being submitted, like if they are in the correct folder in TFS. I am thinking in creating a custom code activity to do this validation, but I am struggling to find out how can I access to the "pending check-in files" and their location on a code activity.

I haven't found out yet if this is possible or not. Anyone have some knowledge of this that can help?

Thank you

PS: Im using TFS2012


Solution

  • There is a variable in the Process called Workspace.

    Pass this into you activity and then you can call GetPendingChanges(), or one of the overloads to inspect the pending changes.

    You can use a Convert Workspace Item to get the local path from Sources Directory and pass that in too, if you need to.