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

Add Component from Stream to other Stream or workspace (RTC 4.0.4)

 Hi,

I am facing a problem while adding Component from a Stream to another new stream or Workspace with java API. Everything seems to be fine using API, but when I try to load this new workspace, I can see the component but not its root folder.
Then I tried to do it from RTC client, and saw I can get Component from "Component Baseline" or "Component in another repository or stream". If I use the 2nd option, I can "inheritate" from the Component root folder . But if I select the 1rst option (reference component), I onyl see the component name and no root folder content when I try to load. Then as a conclusion: I want the same behaviour as the 2nd option "Component in another repository or stream", by using API.
Then my question is: how to get the same from API?

The APIs I am currently using:
IWorkspaceConnection.getComponentsInfo() to get list of components of my referenced stream
And then, to add component:
IWorkspaceConnection newWK = ...;
IComponentAdditionOp addOperation = newWK.componentOpFactory().addComponent(cmp.getComponent(), false);
newWK.applyComponentOperations(Collections.singletonList(addOperation), monitor);
	

 For information: The component I am dealing with is 'projectScoped' and is the default one created with SCRUM project areas.
Did I miss something? Do I need to create and use a specific baseline?

Thanks for any help.

Christel



0 votes



One answer

Permanent link
 Just for information, I finally could get what I wanted:
In case anyone would be interested in that post, here is how I could get my solution:
* get Component (simply with refStream.getComponents() )
* add component to my new stream (newStream.applyComponentOperations(...)
* compare both streams and deliver into new stream change sets from reference stream:

IChangeHistorySyncReport changeSetSync = refStream.compareTo(newStream, ...)
refStream.deliver(newStream, changeSetSync, Collections.EMPTY_LIST,  changeSetSync.outgoingChangeSets(component),  monitor);



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

Question asked: Jan 28 '14, 3:14 a.m.

Question was seen: 5,206 times

Last updated: Jan 28 '14, 11:25 a.m.

Confirmation Cancel Confirm