yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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;
  *]
}