陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
Quintiq file version 2.0
#parent: #root
Method PTF_TestSelectScenario (
  output Real duration_o,
  output String response_o,
  String scenarioname
) as Boolean id:Method_LibPTF_pnlTestRunner_PTF_TestSelectScenario
{
  #keys: '[136682.0.314444068]'
  Body:
  [*
    issuccessful := false;
    
    scenario := select( ScenarioManager, ScenarioNode.astype( Scenario ), scenario, scenario.Name() = scenarioname );
    
    preconditionflag := not isnull( scenario ); // Your precondition before executing the action
    
    if( preconditionflag )
    {
      startprecisionctr := OS::PrecisionCounter();
    
      SelectionScenario.Data( scenario );
    
      duration_o   := this.PTF_GetDurationInMilisecond( startprecisionctr );
      response_o   := 'Select scenario' ;
      issuccessful := true;
    }
    else
    {
      response_o := 'PTF_TestSelectScenario: Precondition failed because scenario not found'; // Your precondition failed reason
    }
    
    return issuccessful;
  *]
}