It's all about the answers!

Ask a question

programatically locate changeset in a stream?


Kelvin Lui (51299) | asked Nov 29 '12, 11:11 p.m.
 Hi, 

I am trying to build the extension plugin to check whether  a changeset has been delivered to specific Stream, as a precondition the WorkItem can be updated to specific state.     Since someone can use the Locate Change Set option through RTC client so I think there must be a correpsonding API to look up a specific changeset in specific stream.

We are using RTC 3.0.1.

I spent quite amount of time to explore the api and figured out this class method to fetch changeset from the stream: workspaceManager.findChangeSets(IChangeSetSearchCriteria, IWorkspaceManager.MAX_QUERY_SIZE, null);

The IChangeSetSearchCriteria is to be used to set the condition.  According the API I can use IChangeSetSearchCriteria.setContext to target for specific stream to search.

Now the remaining question I have is how to specify a specific changeset to be retrieved in the IChangeSetSearchCriteria.

I suspect IChangeSetSearchCriteria.setItem((IVersionableHandle value)which provides the handle for specific changeset to be looked up.

However I couldn't find any api in IChangeSet to return the IversionableHandle object associated with the changeset.   

Otherwise I found out IChange class has three methods defined to return IVersionableHandle object (item(), beforeState(), afterState()).   

Could you please advise what's the best way to be set in IChangeSetSearchCriteria such that I can target for specific changeset?

Comments
Ralph Schoon commented Nov 30 '12, 3:21 a.m. | edited Nov 30 '12, 3:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Kelvin, have you tried the Plug In Spy (Shift+Alt+F1) on the search change sets dialog? If you start there, I would suspect you can find out how the Eclipse client does the search, in case that is what you want to do. I would especially look at the locate change set dialog (not sure if that is available in your version though).


Chris McGee commented Nov 30 '12, 11:36 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

When using plug in spy or the RTC SDK you will need to be careful to use only public API's as anything else is subject to change without notice. You can generally find out what are the public client APIs by looking at the "Plain Java Client Libraries API documentation" download from jazz.net. Any class or service not found in that zip is possibly not public API.

3 answers



permanent link
John Riendeau (46626) | answered Nov 30 '12, 1:22 p.m.
JAZZ DEVELOPER
If all you care about is whether or not the change sets are there, and you've already got your hands on an IWorkspaceManager, you could try this instead of going through the change set search:
 * Use IWorkspaceManager#getWorkspaceConnection() to get an IWorkspaceConnection to the stream
 * Use IWorkspaceConnection#hasChangeSets() to determine if the change sets are there

permanent link
Kelvin Lui (51299) | answered Nov 30 '12, 3:20 p.m.
 Thank you very much.

permanent link
Shimon Nir (241116) | answered Jun 25 '14, 8:41 a.m.
I would like to extend this topic and find out how one can determine what was the original WS/stream where the particular CS was created/delivered to . It is all nice to know wheret he CS was delivered to, in the course of its life but my interest is know its origin. Is there a way ?
Thanks

Your answer


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.