Replace component using client Operations
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:
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.
In both scenario I get this exception:
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.
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.