what's equivalent api for (right click the component in the stream, then "compare with", then "current baseline"
I am using rtc(4.05) client api for a development tools,
I tried to compare the two baseline in the same component and stream, to find out the difference (changeset).
IChangeHistorySyncReport chgHistRpt=blcGm.compareTo(gaStdBl, null); //blcGm is the baseline connection
through the chgHistRpt, neither incoming nor outgoing changeset I got from chgHistRpt has anyting.
What's the equivalent api for (right click the component in the stream, then "compare with", then "current baseline"
How do we baseline comparison.
// gm is the baselineset get from the snapshot
IBaselineSet _gm=(IBaselineSet) im.fetchCompleteItem(_bls.get(0), IItemManager.DEFAULT, null);
List _s=_gm.getBaselines();
IComponent std=null;
IBaseline gmStdBl=null;
log("baseline number", ""+_s.size());
for(Object o: _s){
IBaselineHandle blh=(IBaselineHandle) o;
IBaseline bl= wm.getBaselineConnection(blh, null).getResolvedBaseline();
IComponentHandle ich=bl.getComponent();
IComponent comp=(IComponent) im.fetchCompleteItem(ich, IItemManager.DEFAULT, null);
if(comp.getName().equals("Standard")) {
std=comp;
gmStdBl=bl; //gm baseline for component "standard"
}
}
//next try to get ga baseline from component, the baseline later than gm will be the candidate.
IHistoricBaselineIterator _blsStd=streamConn.getBaselinesInHistory(std, 99, null);
IBaseline gaStdBl=null;
List<? extends IBaselineHandle> blhdls=_blsStd.getBaselines(); //blsStd is the baselineset for standard component
IBaselineHandle gaStdBlHdl=null;
log("baselines number", ""+blhdls.size());
for(IBaselineHandle blhdl: blhdls){
IBaseline bl= wm.getBaselineConnection(blhdl, null).getResolvedBaseline();
IComponentHandle ich=bl.getComponent();
IComponent comp=(IComponent) im.fetchCompleteItem(ich, IItemManager.DEFAULT, null);
if(bl.getId()>gmStdBl.getId()){
gaStdBlHdl=bl;
gaStdBl= wm.getBaselineConnection(bl, null).getResolvedBaseline();
log("standard ga baseline found - (id: " +gaStdBl.getId()+") "+ gaStdBl.getName(), String.format("%s - %s", gaStdBl.getCreationDate(), gaStdBl.getComment()));
break;
}
}
code above is for retrieving the ga/gm baseline.
Comments
Tim Mok
JAZZ DEVELOPER Jun 04 '14, 8:31 a.m.Tim Mok
JAZZ DEVELOPER Jun 04 '14, 4:12 p.m.