It's all about the answers!

Ask a question

How to get a default flow target of IWorkspace (server-side)?


Dong Young Kim (1931820) | asked Jun 18 '12, 5:27 a.m.
JAZZ DEVELOPER
retagged Jun 18 '12, 10:35 a.m. by Evan Hughes (2.4k1218)
I'm going to deliver a change set to a default target when a work item is resolved.
I've got IWorkspace (Repository Workspace) from IChangSet but don't know flow target IWorkspace (Stream).

I tried the code below but query result was empty.
  IWorkspaceSearchCriteria criteria1 = IWorkspaceSearchCriteria.FACTORY.newInstance()
      .setFlowFilter(sourceHandle, FlowFlags.ACCEPT ).setKind(IWorkspaceSearchCriteria.STREAMS);
  List<IWorkspaceHandle> workspaceHandles1 = (List<IWorkspaceHandle>)
      query.findWorkspaces(criteria1, Integer.MAX_VALUE, null).getItemHandles();
  if(workspaceHandles1.size() > 0)
  {
      IWorkspaceHandle targetHandle1 = workspaceHandles1.get( 0 );
      System.err.println("source flow target : " + targetHandle1.getItemId());
      //IWorkspace target1 = (IWorkspace)itemService.fetchItem(targetHandle1, null);
  }

Give me some hints on this. Thx.

2 answers



permanent link
Andrew Niefer (7035) | answered Jun 19 '12, 3:10 p.m.
JAZZ DEVELOPER
edited Jun 19 '12, 3:11 p.m.
You would need to look at the internal  Workspace interface:
<tt>Workspace.getCurrentFlows()</tt> and
<tt>CurrentFlows#getDefaultAcceptFlow() CurrentFlows#getDefaultDeliverFlow()</tt>

permanent link
Dong Young Kim (1931820) | answered Jun 19 '12, 9:01 p.m.
JAZZ DEVELOPER
Thx.

I casted IWorkspace to Workspace and get the flow target.

Workspace.getCurrentFlows() and
CurrentFlows#getDefaultDeliverFlow()

Your answer


Register or to post your answer.