It's all about the answers!

Ask a question

Replace component using client Operations


Michele Pegoraro (1.8k14119103) | asked Nov 30 '11, 6:38 a.m.
Hi,
I'm looking for how to replace a component (in order to re-align it with a baseline) through plain api (RTC 3.0.1).

I've tryed different replace methods of IWorkspaceUpdateOperation:

IWorkspaceUpdateOperation wsUpdateOp = IOperationFactory.instance.getWorkspaceUpdateOperation(WorkspaceUpdateDilemmaHandler.getDefault());

wsUpdateOp.replace(workspaceConnection, baselineConnection);
wsUpdateOp.run(null);


For this first method (which has a wrong javadoc, as it says there is a third parameter: component) I use this scenario: one repository workspace with one component flowing with a stream with the same component. At start time the repository workspace and stream are equals (based on the same baseline). I get an old baseline through BaselineSearchCriteria (setting name and component) and then I run the replace.

Second scenario: two repository workspace, one based on a baseline and the other based on a previous one.
IWorkspaceUpdateOperation wsUpdateOp = IOperationFactory.instance.getWorkspaceUpdateOperation(WorkspaceUpdateDilemmaHandler.getDefault());

wsUpdateOp.replace(workspaceConnectionTarget, workspaceConnectionSource);
wsUpdateOp.run(null);


In both scenario I get this exception:
com.ibm.team.filesystem.client.FileSystemException: Failed to accept, there are component(s) affected that are disconnected

at com.ibm.team.filesystem.client.internal.operations.WorkspaceUpdateOperation.disconnectedComponents(WorkspaceUpdateOperation.java:1098)
at com.ibm.team.filesystem.client.internal.operations.WorkspaceUpdateOperation.runPreConditions(WorkspaceUpdateOperation.java:985)
at com.ibm.team.filesystem.client.internal.operations.WorkspaceUpdateOperation.doAccept(WorkspaceUpdateOperation.java:802)
at com.ibm.team.filesystem.client.internal.operations.WorkspaceUpdateOperation.access$0(WorkspaceUpdateOperation.java:792)
at com.ibm.team.filesystem.client.internal.operations.WorkspaceUpdateOperation$1.run(WorkspaceUpdateOperation.java:702)
at com.ibm.team.filesystem.client.internal.SharingManager.runWithinFileSystemLock(SharingManager.java:802)
at com.ibm.team.filesystem.client.internal.operations.FileSystemOperation.runWithinFileSystemLock(FileSystemOperation.java:164)
at com.ibm.team.filesystem.client.internal.operations.FileSystemOperation.runWithinFileSystemLock(FileSystemOperation.java:144)
at com.ibm.team.filesystem.client.internal.operations.WorkspaceUpdateOperation.execute(WorkspaceUpdateOperation.java:714)
at com.ibm.team.filesystem.client.internal.operations.FileSystemOperation.run(FileSystemOperation.java:89)
at it.nexen.rtc.ucm.sonde.BuildTest.Build4KPI(BuildTest.java:171)
at it.nexen.rtc.ucm.sonde.BuildTest.main(BuildTest.java:77)


I have other components on my Project Area but are not connected to the stream or repository workspaces I'm using.

Any idea on how to use this method?

Thanks,
Michele.

One answer



permanent link
Sergio Lorente (981712) | answered Dec 26 '12, 6:43 a.m.
Hi,

did you find an answer for this question??

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.