Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod Create ( 
 | 
  ScenarioManager scenariomanager, 
 | 
  Strategy strategy, 
 | 
  String name, 
 | 
  Number displayindex, 
 | 
  String description, 
 | 
  Real massscalingfactor, 
 | 
  Real monetaryscalingfactor, 
 | 
  Real timescalingfactor, 
 | 
  Real timeaccountscalingfactor, 
 | 
  Real inventoryholdingscalingfactor, 
 | 
  DateTime lastautoscalingrun, 
 | 
  Boolean isvisible 
 | 
) as Strategy 
 | 
{ 
 | 
  Description: 'Create strategy' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Create new strategy 
 | 
    newstrategy := scenariomanager.Strategy( relnew, 
 | 
                                             Name := name, 
 | 
                                             DisplayIndexForKT := displayindex, 
 | 
                                             Description := description, 
 | 
                                             MassScalingFactor := massscalingfactor, 
 | 
                                             MonetaryScalingFactor := monetaryscalingfactor, 
 | 
                                             TimeScalingFactor := timescalingfactor, 
 | 
                                             TimeAccountScalingFactor := timeaccountscalingfactor, 
 | 
                                             InventoryHoldingScalingFactor := inventoryholdingscalingfactor, 
 | 
                                             LastAutoScalingRun := lastautoscalingrun, 
 | 
                                             IsVisible := isvisible ); 
 | 
     
 | 
    // Update new strategy 
 | 
    newstrategy.Update( name ); 
 | 
     
 | 
    // Check if strategy is null 
 | 
    if( not isnull( strategy ) ) 
 | 
    { 
 | 
      // Traverse all KPIWeigth of the passed in strategy 
 | 
      traverse( strategy, KPIWeight, kpiweight, kpiweight.KPI( relsize ) >0 ) 
 | 
      { 
 | 
        // Create/Update KPIWeight of the new strategy 
 | 
        KPIWeight::Create( newstrategy, kpiweight.KPI(), kpiweight.Weight(), kpiweight.Level() ); 
 | 
      } 
 | 
    } 
 | 
    else 
 | 
    { 
 | 
      // Create/Update KPIWeight of the new strategy 
 | 
      traverse( scenariomanager, KPI, kpi ) 
 | 
      { 
 | 
        KPIWeight::Create( newstrategy, kpi, 0.0, 0 ); 
 | 
      } 
 | 
    } 
 | 
     
 | 
    // To be used in the scenario comparison 
 | 
    if( scenariomanager.Strategy( relsize ) = 1 ) 
 | 
    { 
 | 
      scenariomanager.ActiveStrategy( relset, newstrategy ); 
 | 
    } 
 | 
     
 | 
    return newstrategy; 
 | 
  *] 
 | 
} 
 |