Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method PTF_TestImportSalesDemo ( 
 | 
  output Real duration_o, 
 | 
  output String response_o, 
 | 
  String democategory, 
 | 
  String demoscenario 
 | 
) as Boolean id:Method_LibPTF_pnlTestRunner_PTF_TestImportSalesDemo 
 | 
{ 
 | 
  #keys: '[134266.1.1459548581]' 
 | 
  Body: 
 | 
  [* 
 | 
    // Initialize import sales demo with the server 
 | 
    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                                               
 | 
      scenarioName := GlobalParameters_MP::GetSalesDemoPath(); 
 | 
      scenario := select( ScenarioManager, ScenarioNode.astype( ScenarioMP ), scenario, scenario.Name() = scenarioName ); 
 | 
       
 | 
      isScenarioSelected := ApplicationLibMacroPlanner.SelectScenario( scenario ); 
 | 
     
 | 
      if( isScenarioSelected ) 
 | 
      { 
 | 
        datapath := scenarioName + "/" + democategory + "/" + demoscenario; 
 | 
        MacroPlan.SynchronizeAllFromDefinitionsDirectory( datapath ); 
 | 
         
 | 
        duration_o   := this.PTF_GetDurationInMilisecond( startprecisionctr ); 
 | 
        response_o   := 'Data imported successfully' ; 
 | 
        issuccessful := true; 
 | 
      } 
 | 
      else 
 | 
      { 
 | 
        this.PTF_EndExecution(); 
 | 
     
 | 
        response_o := "Import sales demo failed: scenario " + scenarioName + " does not exists" 
 | 
        debuginfo( response_o ); 
 | 
        MessageBox::Warning( this, response_o, "OK", 1 ); 
 | 
      } 
 | 
    } 
 | 
    else 
 | 
    { 
 | 
      response_o := "PTF_Test_ImportSalesDemo: Import sales demo failed as scenario does not exists"; // Your precondition failed reason 
 | 
    } 
 | 
     
 | 
    return issuccessful; 
 | 
  *] 
 | 
} 
 |