It's all about the answers!

Ask a question

Getting access to a Stream


jean haderer (111) | asked May 12 '11, 12:24 p.m.
Hello,

I have a stream name Stream_One
And a workspace based on it named Workspace_Stream_One

With the Api Java I can get the workspace fine doing :


IWorkspaceSearchCriteria wsSearchCriteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
wsSearchCriteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);
wsSearchCriteria.setPartialOwnerNameIgnoreCase(null);
wsSearchCriteria.setExactName("Workspace_Stream_One");

List <IWorkspaceHandle> workspaceHandles = wm.findWorkspaces(wsSearchCriteria, Integer.MAX_VALUE, this.monitor.getChild());

IWorkspaceConnection conn = wm.getWorkspaceConnection(workspaceHandles.get(0), monitor.getChild());


I can get the Stream easily doing :


IWorkspaceSearchCriteria wsSearchCriteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
wsSearchCriteria.setKind(IWorkspaceSearchCriteria.STREAMS);
wsSearchCriteria.setPartialOwnerNameIgnoreCase(null);
wsSearchCriteria.setExactName("Stream_One");

List <IWorkspaceHandle> workspaceHandles = wm.findWorkspaces(wsSearchCriteria, Integer.MAX_VALUE, this.monitor.getChild());

IWorkspaceConnection conn = wm.getWorkspaceConnection(workspaceHandles.get(0), monitor.getChild());


But How can I get the Stream Object from the Workspace Object not knowing the Stream name ?

Thank you for your support

One answer



permanent link
David Lafreniere (4.8k7) | answered May 12 '11, 5:48 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
But How can I get the Stream Object from the Workspace Object not knowing the Stream name ?
Thank you for your support


In this example, the assumption we're making is that the Stream is the default flow target of that workspace. However keep in mind that you can remove this Stream from it's list of flow targets (open the workspace editor and look at the Flow Targets below)... it can get even more confusing because components within that workspace can flow with other streams (and thus there is not a 1:1 relationship between a workspace and a stream). Take a look through IWorkspaceConnection.getFlowTable() to get an idea of where this workspace is flowing to.

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.