Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method FlatMDSs ( 
 | 
  internal[ComponentMDSInstanceBase] mds 
 | 
) as structured[internal[ComponentMDSInstance]] id:Method_MacroPlannerWebApp_FlatMDSs 
 | 
{ 
 | 
  #keys: '[127066.0.1587346946]' 
 | 
  Body: 
 | 
  [* 
 | 
    target := construct( structured[ComponentMDSInstance] ); 
 | 
    if ( mds.istype( ComponentMDSInstance ) ) 
 | 
    { 
 | 
      target.Add( mds.astype( ComponentMDSInstance ) ); 
 | 
    } 
 | 
    else 
 | 
    { 
 | 
      folder := mds.astype( ComponentMDSFolderInstance ); 
 | 
      traverse( folder, Children, c ) 
 | 
      { 
 | 
        toadd := MacroPlannerWebApp.FlatMDSs( c ); 
 | 
        traverse( toadd, Elements, e ) 
 | 
        { 
 | 
          target.Add( e ); 
 | 
        } 
 | 
      } 
 | 
    } 
 | 
    return ⌖ 
 | 
  *] 
 | 
  ReturnsOwning: true 
 | 
} 
 |