Getting access to a Stream
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 :
I can get the Stream easily doing :
But How can I get the Stream Object from the Workspace Object not knowing the Stream name ?
Thank you for your support
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
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.