Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method SyncMPSPlanFromMacroPlan ( 
 | 
  MacroPlan macroplan, 
 | 
  String mpsplanid, 
 | 
  DateTime timestamp 
 | 
) 
 | 
{ 
 | 
  Description: 'Create mpsplans from from macroplan.' 
 | 
  TextBody: 
 | 
  [* 
 | 
    existing := this.IOMPSPlan( relget ); 
 | 
    updates := construct( IOMPSPlans ); 
 | 
     
 | 
    iompsplan := IOMPSPlan::Create( this, mpsplanid, timestamp ); 
 | 
     
 | 
    updates.Add( iompsplan ); 
 | 
     
 | 
    // Get the set of old mps plans to be deleted 
 | 
    tobedeleteset := existing.Difference( updates ); 
 | 
     
 | 
    traverse( tobedeleteset, Elements, ele ) 
 | 
    { 
 | 
      ele.Delete(); 
 | 
    } 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |