Can I create new link types?
In the OM I found the collection RegisteredLinkTypes. But it has the isFixedSize set to true. Is there someway I can add new link types?
How is the types RelatedLink and ExternalLink mapped to the these RegisteredLinkTypes? I guess that "Related Workitem" and the type RelatedLink match each other. What purpose does the "RegisteredLinkTypes" serve?
And a bonus question :-) Can I link WIs together when I populate the project with WI at creation time? (editing the project template)
Thanks
Hi J?rgen,
To clarify my response below, the OM and all the classes you mention is specifically the WorkItem Object Model. The other components like Source Control etc have their own OMs. However, WorkItem Tracking is currently the only store of links.
RegisteredLinkTypes is a collection of all types of links between TFS artifacts. When you open a WorkItem in the GUI and navigate the links tab, the drop down will show you an enumeration of all registered link types.
The RelatedLink, Hyperlink and ExternalLink objects are available from the WorkItem object model to work with these link types. RelatedLink and Hyperlink objects are essentially shortcuts to working with the 'Related Workitem' and 'Workitem Hyperlink' Registered link types. ExternalLink objects are used for all the other types. In the GUI, when you add a link from one work item to another, a 'RelatedLink' gets created. Similarly, a 'Hyperlink' gets created when you add a hyperlink. The addition of any of the others causes the creation of 'ExternalLink' objects with a RegisteredLinkType to provide more information. Yes it is a bit confusing :).
As far as extending the RegisteredLinkTypes, the reason it is of a fixed size, is because you can't add and remove links via the Object model. The process of registering a new link type is quite intensive and will depend on the scenario you are trying to enable - i.e. create your own artifact-type (like WorkItems), or link existing artifact types differently etc. Give us more info on what scenario you are trying to enable and we'll help you along the way.
I'll let someone else answet the project-creation linking scenario since I'm not familiar with that area.
Thanks,
Karthik
My idea is to use relations to model the development process.
We have Requirements that has one or more UseCases. For each identified UseCase we want the developer to perform a list of Tasks. In a way it is a way to have hierachies of workitems. When I create WorkItem of type "UseCase" I can programatically specify a "RelatedLink" to the Task workitems I create. But I cant be sure that the developer adds more related workitems later on.
As an alternative, I could add a field to the workitems called "RelatedUsecase" stuff in the workitemID on the usecase, and and dont show the field on the form to prevent users from adding/deleting relations.
I looking forward to see your ideas - workitems are really a flexible and useful thing.