It's all about the answers!

Ask a question

baseline names of the component use RTC-SDK-Server- api

siavash ara (111) | asked Nov 03 '19, 11:24 a.m.
hi all

I can use the IComponent  get the InitialBaseline ,how can i get all the baseline names of the component use RTC-SDK-Server- api

IRepositoryItemService itemService=getService(IRepositoryItemService.class);
IComponent this_component = (IComponent)item; 
IBaselineHandle this_baselineHandle = this_component.getInitialBaseline();
IBaseline  this_baseline = (IBaseline) itemService.fetchItem(this_baseline, IRepositoryItemService.COMPLETE);

One answer

permanent link
David Lafreniere (4.4k7) | answered Nov 06 '19, 4:06 p.m.
1) IBaselineSearchCriteria.setComponentRequired(component) to return all baselines in that component. It will return handles (so you'll have only the itemID).

2) Pass the IBaselineSearchCriteria into IScmQueryService.findBaselines()

3) Fetch the full IBaseline from the handles from step 2, and then use IBaseline.getName()

Your answer

Register or to post your answer.