2

I'm looking for a way to extend the RTC client to get the current work item programmatically, or even better add a listener that notifies me whenever the current work item is changed.

I don't know where to start. Any hints?

2 Answers2

3

One can use the following code to get the IWorkItemActivationManager:

IWorkItemActivationManager manager = ClientModel.getWorkItemActivationManager();

Wie this manager, it is possible to use the method getActiveWorkItem to get a IWorkItemHandle:

IWorkItemHandle handle = manager.getActiveWorkItem();

Then the following code can be used to get the IWorkItem:

IAuditableClient auditableClient= (IAuditableClient) Controller.getInstance().getTeamRepository().getClientLibrary(IAuditableClient.class);
IWorkItem item = auditableClient.resolveAuditable(handle, com.ibm.team.workitem.common.model.IWorkItem.FULL_PROFILE, null);

The ClientModel is in the following package: com.ibm.team.workitem.rcp.core

RoflcoptrException
  • 51,941
  • 35
  • 152
  • 200
1

One way I usually explore is the OSLC API through REST call.
With a Chrome and its "Developer Tool" activated, I click on the web client and look at the request done.
That gives an indication of the kind of service involved.

Then you can look at "How to consume the Rational Team Concert change management services", which illustrates how those services are structured.

Combine it with "Extending Rational Team Concert 3.x" and you can start from there.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for the hint. The problem is, I do not think that there is any communication with the server involved. I thin the current work item is only set in the IDE. – RoflcoptrException Nov 24 '12 at 00:38
  • @RoflcoptrException true, yet a bridge like ClearCase is able to track that state in order to define its own current activity: https://jazz.net/downloads/rational-team-concert/releases/3.0?p=news&pp=true#cc-bridge – VonC Nov 24 '12 at 01:48
  • Thanks for all the hints. I finally found a method to get it using plain Java API. I added an answer to this question. – RoflcoptrException Nov 24 '12 at 14:29