Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC 6.2: Not able to fetch all the Streams in a Project using Plan Java API

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

0 votes

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. :)

If Stream is owned by a team then it is not being fetched even if the user is part of that team but able to see and can make  changes from RTC Client, in case  if team is owned by project than it is working fine for both RTC Client and API. 


Accepted answer

Permanent link
>workspaceCriteria.setPartialOwnerName(projectName);

you asked for the ones owned by the project.
Ralph Schoon selected this answer as the correct answer

2 votes

Comments

Agree sam but what is the criteria to get streams part of any project?. If i remove this i am getting some of the streams are not in this project?. I want list all streams i see in RTC client for any project.


One other answer

Permanent link
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
}

0 votes

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,926
× 1,201
× 201
× 23

Question asked: Aug 24 '16, 3:27 a.m.

Question was seen: 3,617 times

Last updated: Sep 03 '16, 11:23 p.m.

Confirmation Cancel Confirm