It's all about the answers!

Ask a question

Server side plug-in which detects delivering of components between cross-CCMs


Krasimir Malchev (56631) | asked Jun 15 '17, 8:03 a.m.
edited Jun 16 '17, 6:26 a.m.

I am developing a server side plug-in which needs to detect the delivery of components between streams / repository workspaces in different CCM servers and change their "owned by" and "visibility" attributes.

I created a Jazz component with service and common parts. The service is activated in response of a deliver operation (with id = com.ibm.team.scm.server.deliver). The Jazz component implements a participant which traverses the changes sets in DeliverOperationData parameter of the participant's "run" method. Then for each change set it finds the corresponding component and the component ComponentOwner. From there it finds the component visibility and if it is equal to "IReadScope.READSCOPE_PRIVATE", the participant changes the component's "Owner By" and "visibility" attributes to a given team area and IReadScope.READSCOPE_TEAM_AREA_PRIVATE, respectively.

Can you please help me find the answers to the following questions:

1) What is the preferred approach to find/detect the source and destination CCMs when delivering components between CCMs?
2) Do you find the described pseudo algorithm good enough to detect the delivery components between servers and change the components owners and visibility from private to a common team area?
3) Why do I need to have "requiredService" tags in the plugin.xml?
4) I use the following code to take an instance to a team area:
IProcessServerService processServer = (IProcessServerService) getService(IProcessServerService.class);
processServer.findProcessArea(areaURI, properties);
How the service knows which CCM to search for the team area in if the repository is not present as a parameter?
5) It looks like the deliver (server) operation is not invoked when a new component() is being delivered/added to a destination workspace (stream or repository workspace). I need to deliver a change set too to enable that operation. How can I detect delivering components without any change sets (i.e. newly created ones)?

Thanks for your support!


Comments
Geoffrey Clemm commented Jun 15 '17, 8:09 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

On question (4), the CCM server that owns the stream receiving the Deliver is the one that triggers the pre-conditions and follow-up actions for the deliver action.  I'm making this a comment, rather than an answer, because I don't have anything to contribute on the other questions.


Krasimir Malchev commented Jun 16 '17, 6:17 a.m.

Hello, Geoffrey.

   Thanks for your comment!  
   I found there is a method AbstractService.getPublicRepositoryURL(...) which returns the URL of the destination repository.
   Though I need the URL of the source repository, too.
    There is a method DeliverOperationData.operationData.getSourceWorkspace().getOrigin() which returns null as it is server side API.
   In other words, as it concerns point 4, I am still not able to get the source CCM.

Greetings,
K. Malchev


Ralph Schoon commented Jun 16 '17, 9:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As far as I can tell, you can only deliver across repositories, if the wokspace connections (repository workspaces/Streams) are related to different repositories. So I would look at the source and target workspace connections. I would have used getOrigin as well, Not sure why that would not work. Can you resoelve the source and target workspace connection? Sorry, I don't have code handy at the moment.

Be the first one to answer this question!


Register or 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.