It's all about the answers!

Ask a question

ProviderFactory in OperationAdvisor: CRJAZ1115I error

David Van Herzele (10121) | asked Aug 12 '11, 9:33 a.m.

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!

4 answers

permanent link
David Van Herzele (10121) | answered Aug 17 '11, 9:45 a.m.
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.

permanent link
Zachary K (19344239) | answered Sep 01 '11, 10:56 p.m.
How did you instantiate ServerProviderFactory as I need it to get the links?
ChangeSetLinks.findLinks(serverProviderFactory, changeSet, null);

Thank you for your help

permanent link
David Van Herzele (10121) | answered Sep 02 '11, 6:29 a.m.
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

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

permanent link
Zachary K (19344239) | answered Sep 02 '11, 7:48 a.m.
Thank you very much for your help.

Your answer

Register or to post your answer.