Quintiq file version 2.0
#parent: #root
Method PTF_TestImportData (
  output Real duration_o,
  output String response_o,
  String scenarioName,
  String path
) as Boolean id:Method_LibPTF_pnlTestRunner_PTF_TestImportData
{
  #keys: '[136682.0.314444056]'
  Body:
  [*
    issuccessful := false;
    
    preconditionflag := true; // Your precondition before executing the action
    
    if( preconditionflag )
    {
      startprecisionctr := OS::PrecisionCounter();
    
      // Call your method here
      // Use the following construct if you want to execute a server method
      scenario := select( ScenarioManager, ScenarioNode.astype( ScenarioMP ), scenario, scenario.Name() = scenarioName );
    
      isScenarioSelected := ApplicationLibMacroPlanner.SelectScenario( scenario );
    
      if( isScenarioSelected )
      {
        this.PTF_SetImportPath( path );
    
        duration_o   := this.PTF_GetDurationInMilisecond( startprecisionctr );
        response_o   := 'Data imported successfully' ;
        issuccessful := true;
      }
      else
      {
        this.PTF_EndExecution();
    
        response_o := "Import data failed: scenario " + scenarioName + " does not exists"
        debuginfo( response_o );
        MessageBox::Warning( this, response_o, "OK", 1 );
      }
    }
    else
    {
      response_o := "PTF_Test_ImportData: Import data failed as scenario does not exists"; // Your precondition failed reason
    }
    
    return issuccessful;
  *]
}
