How to programmatically get the latest snapshot details for a given Stream in RTC SCM.
Accepted answer
IWorkspaceManager#findBaselineSets(...) will return List<IBaselineSet> and you should be able to retrieve all the information with respect to the snapshot from IBaselineSet.
Comments
Thanks for your reply Shashikant. I tried with findBaselineSets(...) but I am unable to get the latest snapshot.....could you please share any sample snippet.
Thanks
IBaselineSetSearchCriteria criteria =
IBaselineSetSearchCriteria.FACTORY.newInstance();
criteria.setOwnerWorkspaceOptional(stream); // stream (IWorkspace) which owns the snapshot. Make sure that the snapshot is owned by the tream. You can verify this by the listing the snapshots of that stream using the RTC client.
If you know which project/team area (IProcessArea) owns the stream:
criteria.setProcessArea(processArea)
List<IBaselineSetHandle> baselineSetHandles = SCMPlatform.getWorkspaceManager(repo).findBaselineSets(criteria, 1, progressMonitor);
List<IBaselineSet> baselineSets = repo.itemManager().fetchCompleteItem(baselineSetHandles.get(0), IItemManager.DEFAULT, progressMonitor);
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} span.s1 {color: #7e504f} span.s2 {color: #0326cc} span.s3 {color: #931a68}
</style>