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

ProviderFactory in OperationAdvisor: CRJAZ1115I error

Hello!

I've been developping some Operation Advisors over the past few weeks for a customer. I've succesfully finsihed development on a couple of them. But I'm experiencing problems for one in particular.

For a Operation Advisor extending the server.deliver operation I need to be able to identify all the files in the delivered changesets as well as their work items.

I currently have all the code ready & working to get the Changesets => Changes => Versionables of the deliver operation. However I'm having a lot of trouble identifying how to get my hands on the associated workitems.

As far as I understand I can use the WorkspaceManager or ChangeSetLinks classes to search for workitems associated to a particular changeset. Since I'm serverside I understand WorkspaceManager is out of the picture. But to be able to use ChangeSetLinks I need a ProviderFactory.

Whenever I call getService(ProviderFactory.class) I get a CRJAZ1115I error stating the service was not registered.

I tried looking at the RequireWorkItemApprovalAdvisor as an example but it has a constructor which takes a ProviderFactory as a param.. If I try to mimic this I get errors whenever my OperationAdvisor is instancied.

So my questions is how can I get associated workitems from a deliver operation (serverside)?

Thanks in Advance!

0 votes



4 answers

Permanent link
I managed to find a way to obtain workitem information with ServerProviderFactory which is an internal class.

This will do for now, but I'm still interested in a way to obtain that info without the use of an internal class.

0 votes


Permanent link
Hi,
How did you instantiate ServerProviderFactory as I need it to get the links?
ChangeSetLinks.findLinks(serverProviderFactory, changeSet, null);

Thank you for your help

0 votes


Permanent link
To be able to obtain a ServerProviderFactory instance you need an AbstractScmService object.
ServerProviderFactory serverProviderFactory = new ServerProviderFactory(IAbstractScmService, IRepositoryItemService)


To obtain the AbstractScmService I replaced the class declaration of my advisor from:
public class AdvisorName extends AbstractService implements IOperationAdvisor

to
public class AdvisorName extends AbstractScmService implements IOperationAdvisor


This works for me. However this is an internal class and direct use of this class is strongly discouraged! You've been warned ;-)

I'm still interested in a way to obtain associated workitems of a changeset without using internal classes if a SDK guru swings by this thread

0 votes


Permanent link
Thank you very much for your help.

0 votes

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,938

Question asked: Aug 12 '11, 9:33 a.m.

Question was seen: 6,435 times

Last updated: Aug 12 '11, 9:33 a.m.

Confirmation Cancel Confirm