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

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.

0 votes

Comments

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

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

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,938
× 1,202

Question asked: Jun 03 '14, 2:34 p.m.

Question was seen: 4,617 times

Last updated: Jun 04 '14, 4:12 p.m.

Confirmation Cancel Confirm