1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  | Quintiq file version 2.0 
 |  #parent: #root 
 |  Method CleanKB () id:Method_ApplicationLibMacroPlanner_CleanKB 
 |  { 
 |    #keys: '[11660.0.318162580]' 
 |    Body: 
 |    [* 
 |      // Clean up KB 
 |      editor := CKBEditor::Create(); 
 |       
 |      //Check if macroplan dataset is selected, if not, don't clean KB 
 |      if( not isnull( MacroPlan ) ) 
 |      { 
 |        kb := select( MacroPlan.MDSMacroPlan(), MDSKBs, kb, kb.Name().ToUpper() = ScenarioManager.CompanyKBName().ToUpper() ); 
 |        kbfullid := KBFullID::Create( kb.Domain(), kb.Name(), kb.Branch(), kb.Version(), kb.ChangeNr() ); 
 |       
 |        infos := editor.GetKBStructure( kbfullid.KBID() ); 
 |        traverse( infos, Elements.KBFullID, i ) 
 |        { 
 |          editor.DeleteAllButLatestKBChange( i ); 
 |        } 
 |      } 
 |    *] 
 |  } 
 |  
  |