Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC Java API - Reading attribute value using workitemcommon

Hi,
     I have a working code. Where I need to verify either my understanding is correct or to find the right way to do it.

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.

0 votes



One answer

Permanent link

You have to distinguish the server and the client API. There are small differences. 
https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ is client API. The server API is very similar. However getting services and client libraries is different. See https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ for the server API. It uses

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.

1 vote

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Jul 25 '17, 4:34 a.m.

Question was seen: 3,671 times

Last updated: Jul 25 '17, 3:31 p.m.

Confirmation Cancel Confirm