Quintiq file version 2.0
#parent: #root
Method GetMacroPlans () as structured[MacroPlan] id:Method_ApplicationMacroPlanner_GetMacroPlans
{
  #keys: '[412672.1.82702269]'
  Body:
  [*
    componentmds := ApplicationScope.ComponentMDS();
    
    macroPlans := construct( MacroPlans );
    scemps := selectset( ScenarioManager,ScenarioMP,mp,mp.IsLoaded());
    traverse( scemps,Elements,scemp ){
      mdsinstance     := select( componentmds, ComponentMDSKinds.ComponentMDSInstances, m, m.MDSID().MDSKey() = scemp.DatasetMDSID() );
      handle          := mdsinstance.GetMDSHandle();
      demandMacroPlan := handle.AsMacroPlan();
      macroPlans.Add( demandMacroPlan );
    }
    
    return &macroPlans
  *]
  ReturnsOwning: true
}
