Getting hold of an AbstractService instance from op. part.
Hi,
It's probably a really dumb question, but I am writing a WorkItem save Operation Participant, and I want to get hold of an ITeamBuildRequestService instance. Now I know AbstractService.getService() will give me that but I don't know how to get hold of an AbstractService implementing object from inside the participant. Currently I'm doing something similar to the following, but it's deprecated so I'd like to do it the intended way but unable to work out how to get an AbstractService instance. public void run(final AdvisableOperation operation, final IProcessConfigurationElement participantConfig, final IParticipantInfoCollector collector, final IProgressMonitor monitor) Any help would be appreciated as I'm sure the answer is obvious - I had thought about having my OperationPartipant extend AbstractService, but that doesn't seem right as the participant isn't a service. Thanks, Dan |
2 answers
Maybe I answered my own question as there are server side operation participants in the Jazz source which extend AbstractService (com.ibm.team.reports.service.internal.process.ReportsProjectParticipant, and all of the ones in package com.ibm.team.process.internal.definitions.server) so seems that's how it should be done.
Just seems odd from as I hadn't thought of Operation Participants as Jazz Services, and I thought the Operation Participant would be passed an instance as a parameter rather than just extending AbstractService - I guess it's because I'm just used to the old way of getting passed an IAuditableCommon. Time to adjust to the new way... |
Did you get this to work? I tried extending AbstractService for an Operation Advisor and every time I try using the getService(IWorkItemServer.class) call, I get an exception. I am trying to use getPeer, but don't want to rely on that since it is deprecated. Thanks for any help you can provide.
Maybe I answered my own question as there are server side operation participants in the Jazz source which extend AbstractService (com.ibm.team.reports.service.internal.process.ReportsProjectParticipant, and all of the ones in package com.ibm.team.process.internal.definitions.server) so seems that's how it should be done. |
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.