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.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!
Operation Advisor - Prevent unwanted links between workitems
EduardoBello 270003RXWC Marcações:  link rational jazz code prevent advisor sample rtc extending 1 Comentário 10.915 Visualizações