Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method StartAfterPreprocessing (Boolean canstart, LibOpt_SnapshotOptimizerRunController snapshotruncontroller) as stream[JSON] 
 | 
{ 
 | 
  Description: 
 | 
  [* 
 | 
    If the `LibOpt_OptimizerRunController` gives approval to start the run, then this method calls `StartAfterPreprocessing` to start the `LibOpt_Run`. 
 | 
     
 | 
    This method creates a snapshot if the `LibOpt_Run` was aborted while it was waiting for approval from the `LibOpt_OptimizerRunController`. 
 | 
  *] 
 | 
  TextBody: 
 | 
  [* 
 | 
    result := null( stream[JSON] ); 
 | 
     
 | 
    // While unlikely, a run can be aborted after the optimizer gave approval to start the run, but before this method is called.  
 | 
    // So we include not this.IsAborted() to ensure that the run isn't accidentially started anyway. 
 | 
    if( canstart and not this.IsAborted() ) 
 | 
    { 
 | 
      snapshotruncontroller.StartedOn( DateTime::Now() ); 
 | 
      result := this.StartAfterPreprocessing(); 
 | 
    } 
 | 
    else 
 | 
    { 
 | 
      this.Stop(); 
 | 
      LibOpt_SnapshotWarning::Throw( this,  
 | 
                                     snapshotruncontroller, 
 | 
                                     Translations::LibOpt_OptimizerRunController_WarningAbortedWhileRequested(),  
 | 
                                     LibOpt_Issue::Severity_2_Low() ); 
 | 
    } 
 | 
     
 | 
    return result; 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |