Problem with "setCurrent" and "setDefault"
Javier Lisbona (51●5●7)
| asked Oct 03 '11, 11:03 a.m.
edited May 31 '16, 9:56 p.m. by David Lafreniere (4.8k●7)
Hi team,
I have a problem in a FlowTable. I'm trying to put a My code: ------------------------------------------------------ //Create workspace IWorkspaceConnection wsc = workspaceManager.createWorkspace(teamRepository.loggedInContributor(), Workspace_name, Workspace_name, null); //Add component List<IComponentOp> ops = new ArrayList<IComponentOp>(); //ops.add(wsc.componentOpFactory().addComponent(auxcomp, false)); ops.add(wsc.componentOpFactory().addComponent(auxcomp, true)); wsc.applyComponentOperations(ops, null); IWorkspaceSearchCriteria search2 = IWorkspaceSearchCriteria.FACTORY.newInstance(); search2.setExactName(Workspace_name); List<IWorkspaceHandle> handles2 ; handles2 = workspaceManager.findWorkspaces(search2, Integer.MAX_VALUE, null); IWorkspace iwspaux2 = null; for( IWorkspaceHandle aux2:handles2 ){ iwspaux2 = (IWorkspace) teamRepository.itemManager().fetchCompleteItem(aux2,0,null); } IWorkspaceHandle myws = (IWorkspaceHandle) iwspaux2; IWorkspaceConnection workspaceConnection2 = workspaceManager.getWorkspaceConnection(myws, null); IFlowTable flowTable2 = workspaceConnection2.getFlowTable().getWorkingCopy(); flowTable2.removeDeliverFlow(workspaceConnection2.getResolvedWorkspace()); flowTable2.addDeliverFlow(workspaceConnection.getResolvedWorkspace(), null, null, Collections.singletonList(cmp), cmp.getName().toString()); flowTable2.setComponentScopes(workspaceConnection.getResolvedWorkspace(), Collections.singletonList(cmp)); List<IFlowEntry> entries = flowTable2.deliverTargets(); flowTable2.setCurrent(entries.get(0)); flowTable2.setDefault(entries.get(0)); wsc.setFlowTable(flowTable2, null); ----------------------------------------------------- There is no error message but it doesn't work. Could anyone help me? Any help would be appreciated. Thanks in advance!! BR Javier Lisbona |
Accepted answer
Solution:
...................... ...................... List<IFlowEntry> entries = flowTable2. List<IFlowEntry> entries = flowTable2.acceptFlows(); ...................... ...................... :-) Ralph Schoon selected this answer as the correct answer
Comments
Hakki Bozkurt
commented May 16 '16, 3:23 a.m.
Hi Javier, I dont understant solution...
Here is my code, what am I missing?
IFlowTable flowTable = wc.getFlowTable().getWorkingCopy();
flowTable.addDeliverFlow(targetStreamConnection.getResolvedWorkspace(), repo.getId(), repo.getRepositoryURI(), null, targetStreamConnection.getDescription());
IFlowEntry newnode = flowTable.getDeliverFlow(targetStreamConnection.getResolvedWorkspace());
flowTable.setCurrent(newnode);
flowTable.setDefault(newnode);
wc.setFlowTable(flowTable, monitor);
Hakki Bozkurt
commented May 16 '16, 4:07 a.m.
I found :D
wrong -> correct
flowTable.addDeliverFlow -> flowTable.addAcceptFlow
|
2 other answers
Ok, I know the problem:
--> "Yes, there is a problem, you are changing the ' should change the ' The flow table API method names are misleading, and it is possible that we'll be changing this in the future (partially to sort out this confusion you're experiencing now). The 'acceptFlows' are for the collaborations. The 'deliverFlows' are for helping identify component additions/removals (I believe. Somebody correct me if I'm wrong.) " |
Somehow it makes sense: even if you see it as a "Flow target" you must establish a connection for both accepting and delivering change sets.
This is used also in com.ibm.team.scm.client.tests.tools.samples.SampleChangeSets.SampleChangeSets(ITeamRepository, String, boolean)
...
workspaceConnection = createUniqueWorkspace(repo); |
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.