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!
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
To be able to obtain a ServerProviderFactory instance you need an AbstractScmService object.
To obtain the AbstractScmService I replaced the class declaration of my advisor from:
to
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
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