Baseline History

Hi!

I have this problem, it was sent to me this big frankenstein of a dxl, of whose I recognize a part of the Galaxy script for look for a requirement history over it's baselines.

The thing is, it looks like the idea was: in a module a I would choose a requirement, this requirement have some info in another module, so from this Reqmt I would open the other module and look for the reqmt historic of this module that I opened.

It almost works, the thing is that it only shows the current changes and not the baselines ones.

If you guys dont want to have the headache of looking at this dxl, its okay. I think the problem is in there:

 

void HP_populateBox(Module OtherModule, Object OtherObj) {
 
   Skip baselines = create
   int baselineCount = 0
   Baseline b
 
   for b in OtherModule do {
      if ( !null b ) {
      baselineCount++
         put( baselines, baselineCount, b )
      }
   }
   
   HB_oldAttrValues = create
   HB_newAttrValues = create
   
   // Populate History records for Baselines
   int historyRecordCount = 0
   Module baselineModule
   for b in baselines do {
      baselineModule = load( b, false )
      if ( !null baselineModule ) {
         HB_populateHistoryListBox( HB_historyListViewDBE, baselineModule, OtherObj, b, historyRecordCount )
      }
   }
   delete baselines
 
   // Populate History records for current Version of Module
   ( current ModuleRef__ ) = OtherModule
   HB_populateHistoryListBox( HB_historyListViewDBE, OtherModule, OtherObj, null, historyRecordCount )
}

 

The last 3 lines works, it made me think that the ( current ModuleRef__ ) = OtherModule is the one doing it. If I do a print it shows me that it is indeed opening the OtherModule.

But for the part of the baselines it does not. 

Can someone give me a idea?

Sorry for the english.


braolive - Thu Feb 20 14:55:30 EST 2014

Re: Baseline History
llandale - Thu Feb 20 16:35:03 EST 2014

"OtherObj" is an "Object" handle in the current version only.  That handle does NOT exist in any of the baselines.  You need to get its integer AbsNo, then search for the Object in the "baselineModule" that has that same AbsNo, then call your HistoryListBox function with THAT object.

On other news.. I have a nagging suspition the following comment is wrong, but here goes:

I think you need that "current = OtherModule" at the top of this function since the "load" function seems to presume "the current module".

When I muck around with the "current" module, I do it like this:

  • Module mCurr = current   // Module current when this function was called
  • current = mNew     // Module passed into this function
  • whaterver this function does with mNew
  • if (!null mCurr) mCurr = current

This way the function reinstates whichever module was "current" when it was called; no telling where else in the code that may matter.

My nagging suspision is that the "load" function, oddly, indeed requires a "current Module", and even more oddly it doesn't matter what module that is.  It's as if if first checks for a "current Module" and returns; otherwise it doesn't need it.

-Louie