Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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:

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.

1 vote



One answer

Permanent link
Hi,

did you find an answer for this question??

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Nov 30 '11, 6:38 a.m.

Question was seen: 6,080 times

Last updated: Dec 26 '12, 6:43 a.m.

Confirmation Cancel Confirm