Getting a change set handle from a change set id
I'm working on some configuration management tools to interface with RTC using the Plain Java Libraries. I have a change set id -- like "_ZYdu...pakQ" -- that was saved off when we added change sets to RTC. I want to later use that change set ID to get the IChangeSetHandle to link our tools back to RTC. I think I have the first and last bits figured out:
String changeSetId = "something" IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(REPO); IChangeSetSearchCriteria criteria = IChangeSetSearchCriteria.FACTORY.newInstance(); ??????????????? List<IChangeSetHandle> results = wm.findChangeSets(changeSetCriteria, IWorkspaceManager.MAX_QUERY_SIZE, MONITOR); IChangeSetHandle handle = results.get(0); //Should only be one match with that ID
...but I can't figure out the middle part to define the criteria. I tried:
criteria.setSourceId(UUID.valueOf(changeSetId));
...but that didn't work. What am I missing?
|
Accepted answer
Generally the way to get an object from its UUID is the following:
ObjectInterface.ITEM_TYPE.createItemHandle(UUID.valueOf(uuidValue), null); In your case it will be IChangeSetHandle handle = (IChangeSetHandle) IChangeSet.ITEM_TYPE.createItemHandle(UUID.valueOf("_ZYdu...pakQ"), null); Michele. Doug Effler selected this answer as the correct answer
|
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.