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

Multiple operation on a file in a changeset

I'm trying to rename and modify a file in RTC in a single change set using API.
I'm using the code like this.

fileItem.setName("new_name");

fileItem.setContent(content);

List<IConfigurationOp> itemsToCommit = new ArrayList<IConfigurationOp>();

itemsToCommit.add(IWorkspaceConnection.configurationOpFactory().save(fileItem));

itemsToCommit.add(IWorkspaceConnection.configurationOpFactory().save(fileItem1));
itemsToCommit.add(IWorkspaceConnection.configurationOpFactory().save(fileItem2));
itemsToCommit.add(IWorkspaceConnection.configurationOpFactory().save(fileItem3));
...
IWorkspaceConnection.commit(changeSet, itemsToCommit, monitor);


But then I realize that if there are more than one operations involved as in case of fileItem (setName and setContent) then latest operation is committed. In this case file 'fileItem' is modified but it is not renamed to the new name. If I try to add it to itemsToCommit twice (i.e after each operation) then I get an exception. How can I handle this?

0 votes


Be the first one to answer this question!

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,948

Question asked: Jun 08 '10, 9:25 a.m.

Question was seen: 4,581 times

Last updated: Jun 08 '10, 9:25 a.m.

Confirmation Cancel Confirm