RTC 6.2: Not able to fetch all the Streams in a Project using Plan Java API
![]()
Naveen Tyagi (197●57●151)
| asked Aug 24 '16, 3:27 a.m.
edited Sep 03 '16, 11:23 p.m. by David Lafreniere (4.8k●7)
I am trying to fetch list of all steams in a project. Although it is working fine expect for the project being used in production, i am getting only one stream which is created for Exploration/Testing purpose and project contains more than 30 streams. I have added myself in the team which owns particular stream but still not able to see, Where as i am able to see and delivered in stream from Eclipse Client. What could be possible reason. Thanks in advance.
Here is my code in which repository is class level object. public List<Stream> getStreamList(String projectName) { List<Stream> streamInfoList = new ArrayList<Stream>(); final IWorkspaceManager mgr = SCMPlatform.getWorkspaceManager(repository); IWorkspaceSearchCriteria workspaceCriteria = IWorkspaceSearchCriteria.FACTORY.newInstance().setKind(IWorkspaceSearchCriteria.STREAMS); workspaceCriteria.setPartialOwnerName(projectName); List<IWorkspaceHandle> streamList; try { streamList = mgr.findWorkspaces(workspaceCriteria, Integer.MAX_VALUE, null); Stream tempStreamObj = null; for (IWorkspaceHandle iWorkspaceHandle : streamList) { IWorkspaceConnection stream= mgr.getWorkspaceConnection(iWorkspaceHandle, null); tempStreamObj = new Stream(); tempStreamObj.setStreaname(stream.getName()); streamInfoList.add(tempStreamObj); } }catch (Exception e) { e.printStackTrace(); } return streamInfoList; }//End of Method |
Accepted answer
One other answer
![]()
i have a utility that copies projects, and it does streams and workspaces too..
my code does (same loop as you ) IWorkspaceConnection stream= mgr.getWorkspaceConnection(iWorkspaceHandle, null); if( stream.getProcessArea(null).getItemId().getUuidValue().equals(owning_project.getProjectArea().getItemId().getUuidValue()) ) { // proccess stream owned by this project } |
Comments
how are you doing the 'fetch all streams'?
I just updated the question with source code.
I get the reason but don't know the solution. :)