RTC Java API - Reading attribute value using workitemcommon
Hi,
public class HandleWorkflowOnStateChangeParticipant extends AbstractService implements IOperationParticipant {
public void run(AdvisableOperation operation, IProcessConfigurationElement participantConfig, IParticipantInfoCollector collector, IProgressMonitor monitor) throws TeamRepositoryException {
WorkItemCommon workItemCommon = (IWorkItemCommon) getService(IWorkItemServer.class);
}
}
I was creating the operation participant for the first time. Where I have a requirement to the read the attribute value. And some where in the forum I found few codes. Also, from the following links, https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/
I am not sure how to retrieve
"fTeamRepository" IWorkItemCommon workItemCommon = (IWorkItemCommon ) fTeamRepository.getClientLibrary(IWorkItemCommon.class);
Now, I am able to use "workItemCommon", not by using the above line, but it is done using "getService".
Can anyone suggest me whether I did in right way using "getService". Or, how or retrieve "fTeamRepository".
Thanks. |
One answer
Ralph Schoon (63.7k●3●36●48)
| answered Jul 25 '17, 3:16 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jul 25 '17, 3:31 p.m. You have to distinguish the server and the client API. There are small differences.
AbstractService.getService() to get the service IWorkItemServer and IWorkItemCommon ITeamRepository.getClientLibrary() only works in the client API, getService() only in the server API if you extend AbstractService. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.