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

Setting the last baseline while adding a component

Hi,
I'm working on a server side extension which add a component to a stream. I'm using this code:

IWorkspaceHandle udcStream  = listOfStream.get(0);

...
List<IComponentOpDescriptor> componentOpDescriptorList = new ArrayList<IComponentOpDescriptor>();
...
List<IComponentHandle> componentList = scmQuery.findComponents(componentCriteria, 1, null).getItemHandles();
IComponentHandle componentHandle = componentList.get(0);
componentOpDescriptorList.add(IComponentOpDescriptor.FACTORY.addComponent(componentHandle, true));
...
scmService.updateComponents2(udcStream, null, (IComponentOpDescriptor[])componentOpDescriptorList.toArray(new IComponentOpDescriptor[componentOpDescriptorList.size()]), false, false, ScmDtoFactory.eINSTANCE.createWorkspaceRefreshParameter(), null, null);


It works good, excepting for one thing: the component which I add has only the initial baseline. How can I set another baseline?


Thanks,
Michele.

1 vote



One answer

Permanent link
 Old Question I know but thought I'd share what I found because I faced the same issue:

You have to find the baseline handle and componentHandle you want (https://jazz.net/forum/questions/34375/how-to-retrieve-the-name-of-a-baseline-set) and then use them when adding the components like this:

componentOpDescriptorList.add(IComponentOpDescriptor.FACTORY.addComponent(componentHandle, baselineHandle, true));
	

You can also use IComponentOpDescriptor.FACTORY to build the array for you like this:

scmService.updateComponents2(udcStream, null, IComponentOpDescriptor.FACTORY.array(IComponentOpDescriptor.FACTORY.addComponent(componentHandle, baselineHandle, true), false, false, ScmDtoFactory.eINSTANCE.createWorkspaceRefreshParameter(), null, null);
		

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

Question asked: Oct 05 '11, 12:36 p.m.

Question was seen: 3,780 times

Last updated: Mar 01 '13, 3:53 p.m.

Confirmation Cancel Confirm