Extending Rational Team Concert - RTC Extending
Matching: link X
The RTC has many types of links that we can use, but depending on the software development process of your business, you may feel the need to create a new type of relationship between WorkItems. In my opinion, this creation of new link types, although not very complicated, could be more simplified.
Anyone who has read the previous posts or have developed some plugin for RTC will have no difficulty in creating a new type of link, because it is nothing more than a plugin. The main difference is that you have to install the plugin on the server and if you use the Ide Client you have to install the eclipse plugin directly into the client as well.
As I said earlier a link type is a plugin, so the first step is to create a Plug-in Project
Name your plugin, in our case we call it rtc_rework_link, as it will indicate that a workitem is a Rework opened by another (Rework Opener). Remember, do not select any additional options to create the plugin.
Go to Dependencies tab and add the plugin com.ibm.tean.repository.common
Now, go to the Extensions tab, add the Extension Point com.ibm.team.repository.common.linkTypes. Then right click on newly created item, choose New -> LinkTypes. Fill out the following properties:
In plugin.xml tab, which is actually the source code of the plugin, add the elements <source> and <target> to the <linkType> element that was created in the previous step. Note that you can skip the previous step and configure directly the plugin.xml with all options. I chose to show the previous step so that you can relate the tab with the xml element.
The above code defines a type of link that connects two WorkItems (itemReferenceType). One source WorkItem will be called Rework and has cardinality 0..n, and the target WorkItem will be called WorkItem Rework Opener and have cardinality 0..1.
There, the plugin is finished. Only thing left is the well-known steps of creating a feature for the plugin, create the update site for the feature and deploy the site on the server. If you have questions regarding these steps take a look at this post to remember.
As I mentioned at the beginning of the post, if you use the RTC Client (Eclipse) will need to install the plugin directly on the client. This is done in the same way you install any plugin via the Eclipse Update Sites. Access: Help -> Install New Software... . Click Add to add the new site, choose the location where the Update Site was compiled, select your plugin and install it normally.
Any questions just email me, tweet or comment here. See you!
EduardoBello 270003RXWC Tags:  link rational jazz code prevent advisor sample rtc extending 1 Comment 13,707 Views
Hello, It has been a while since I posted here, I've been really busy, but I got a few minutes of free time to write this example of Operation Advisor which aims to prevent a certain type of workitem to be linked to another workitem of a different type.
For this example, let's make Tasks workitems unable to link Defect workitems as children. You can easily change the types of workitems and links in this example to suit your needs. The purpose of this and future posts is to get familiar with the API Jazz.
Before proceeding it is essential that you already know the first steps to creating a RTC plug-in, if you do not know stop here and read this previous post that explains the basic steps with a simple example.
First create your Plug-in Project and select Dependencies tab and add most frequently used plugins as required (com.ibm.team.process.service, com.ibm.team.workitem.common, com.ibm.team. workitem.service, com.ibm.team.process.common, com.ibm.team.repository.common, com.ibm.team.repository.service) and import the package org.eclipse.core.runtime. After that, it is important that you save the project to refresh the workspace.
Let's select Extensions tab and add our Extension Point for this plugin. And since this is a pre-condition and will not change the state of the workitem, let's use an Operation Advisor.
Look for: com.ibm.team.proccess.service.operationAdvisors. This option only appears if you have correctly added the required plugins as mentioned earlier.
Fill the following fields:
id: Identifier of the advisor
class: Java class that will be called by the advisor
name: Name by which the advisor will be identified in the process settings.
operationId: Id of the operation where the advisor will be injected.
Add an extension service, Right click, New -> extensionService and fill an id and use the same class used in the extension point.
Now let's the code:
All done! Now just create the feature and the site and upload the plugin to server.
I will try to shorten the time between posts, but by May it can be a bit difficult. See you next time!