It's all about the answers!

Ask a question

what's equivalent api for (right click the component in the stream, then "compare with", then "current baseline"


haiyang huang (1112) | asked Jun 03 '14, 2:34 p.m.
edited Jun 04 '14, 12:28 p.m.
 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 commented Jun 04 '14, 8:31 a.m.
JAZZ DEVELOPER

That appears to be the correct way to compare baselines. What's the code that you have for retrieving the baselines?


Tim Mok commented Jun 04 '14, 4:12 p.m.
JAZZ DEVELOPER

Where is blcGm in your snippet? It's compared to a baseline but have you verified that the baseline connection is the correct baseline?

Also, running comparisons on baselines using the id is not recommended. The Javadoc states that it is not guaranteed to be unique.

One answer



permanent link
haiyang huang (1112) | answered Jun 04 '14, 12:26 p.m.
edited Jun 04 '14, 12:27 p.m.

Your answer


Register or 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.