Quintiq file version 2.0
#parent: #root
Method PTF_DoAction (
  String actionString
) id:Method_LibPTF_pnlTestRunner_PTF_DoAction
{
  #keys: '[102890.0.1865509278]'
  Body:
  [*
    // Perform the actions that is defined on the script
    errormsg         := '';
    issuccessful     := false;
    isstandardaction := true;
    duration         := 0.0;
    response         := '';
    
    try
    {
      parameters   := construct( Strings );
      action       := this.PTF_GetActionAndParameters( actionString, &parameters );
      issuccessful := this.PTF_DoStandardAction( action, parameters, isstandardaction, response );
    
      if( not isstandardaction )
      {
        this.PTF_DebugInfoAction( action, "" );
    
        // MODELING HANDLE - PLEASE IMPLEMENT YOUR TEST METHODS HERE
        if( action = "PTF_TestQuickTestPTF" )
        {
          issuccessful := this.PTF_TestQuickTestPTF( duration, response );
        }
        else if( action = "CreateScenario" )
        {
          scenarioname := parameters.Element( 0 );
          storagestate := parameters.Element( 1 );
          issuccessful := this.PTF_TestCreateScenario( duration, response, scenarioname, storagestate );
        }
        else if( action = "ImportData" )
        {
          scenarioname := parameters.Element( 0 );
          path := parameters.Element( 1 );
          issuccessful := this.PTF_TestImportData( duration, response, scenarioname, path );
        }
        else if( action = "DuplicateScenario" )
        {
          scenarioname := parameters.Element( 0 );
          newscenarioname := parameters.Element( 1 );
          issuccessful := this.PTF_TestDuplicateScenario( duration, response, scenarioname, newscenarioname );
        }
        else if( action = "SelectScenario" )
        {
          scenarioname := parameters.Element( 0 );
          issuccessful := this.PTF_TestSelectScenario( duration, response, scenarioname );
        }
        else if( action = "LaunchOptimizer" )
        {
          strategy := parameters.Element( 0 );
          profile := parameters.Element( 1 );
          start := parameters.Element( 2 );
          end := parameters.Element( 3 );
          issuccessful := this.PTF_TestLaunchOptimizer( duration, response, strategy, profile, start, end );
        }
        else if( action = "DeleteScenario" )
        {
          scenarioname := parameters.Element( 0 );
          issuccessful := this.PTF_TestDeleteScenario( duration, response, scenarioname );
        }   
        else if ( action = "UpdateShiftPattern" )
        {
          unitname := parameters.Element( 0 );
          shiftpattern := parameters.Element( 1 );
          start := parameters.Element( 2 );
          issuccessful := this.PTF_TestUpdateShiftPattern( duration, response, unitname, shiftpattern, start );
        }
        else if ( action = "ScenarioComparison" )
        {
          formname := parameters.Element( 0 );
          listname := parameters.Element( 1 );
          scenario := parameters.Element( 2 );
          scenario2 := parameters.Element( 3 );
          issuccessful := this.PTF_TestSelectScenarioComparison( duration, response, formname, listname, scenario, scenario2)
        
        }
        else if ( action = "UpdateSizing" )
        {
          pispipsize := parameters.Element( 0 );
          operationsize := parameters.Element( 1 );
          productcombisize := parameters.Element( 2 );
          issuccessful := this.PTF_TestUpdateResourceManagerParameter( duration, response, pispipsize, operationsize, productcombisize );
        }  
        else if ( action = "ImportSalesDemo" )
        {
          democategory := parameters.Element( 0 );
          demoscenario := parameters.Element( 1 );
          issuccessful := this.PTF_TestImportSalesDemo( duration, response, democategory, demoscenario );
        }
        else
        {
          this.PTF_EndExecution();
    
          response := "Action : " + '"' + action + '"' + " is not found, please check your test script.";
    
          debuginfo( response );
          MessageBox::Warning( this, response, "OK", 1 );
        }
      }
    }
    onerror
    {
      errormsg := 'Quintiq system error starts here: ' +
                  e.GeneralInformation() +
                  e.DetailedInformation() +
                  e.DeveloperInformation();
    }
    
    response := response + errormsg;
    response := response.ReplaceAll( String::NewLine(), '  ' );
    
    this.vhDoActionInfoReturn().Value( [String]duration
                                                + '|' + [String]issuccessful
                                                + '|' + response
                                              );
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    // Perform the actions that is defined on the script
    /*errormsg         := '';
    issuccessful     := false;
    isstandardaction := true;
    duration         := 0.0;
    response         := '';
    
    try
    {
      parameters   := null( Strings );
      action       := this.PTF_GetActionAndParameters( actionString, parameters );
      issuccessful := this.PTF_DoStandardAction( action, parameters, isstandardaction, response );   
    
      if( not isstandardaction )
      {
        // Anticipate on maximum 5 parameters.
        /* Use the following parameters if applicable
        param1 := guard( parameters.Element( 0 ), "" );    
        param2 := guard( parameters.Element( 1 ), "" );
        param3 := guard( parameters.Element( 2 ), "" );
        param4 := guard( parameters.Element( 3 ), "" );
        param5 := guard( parameters.Element( 4 ), "" );
        */
    
     /*   this.PTF_DebugInfoAction( action, "" );
    
        // PTF MODELING HANDLE - PLEASE IMPLEMENT YOUR TEST METHODS HERE
        if( action = 'QuickTestPTF' )
        {
          issuccessful := this.PTF_TestQuickTestPTF( duration, response );
        }   
        else
        {
          this.PTF_EndExecution();
    
          response := "Action : " + '"' + action + '"' + " is not found, please check your test script.";
    
          debuginfo( response );
          MessageBox::Warning( this, response, "OK", 1 );
        }
      }
    }
    onerror
    {
      errormsg := 'Quintiq system error starts here: '
                + e.GeneralInformation()
                + e.DetailedInformation()
                + e.DeveloperInformation();
    }
    
    response := response + errormsg;
    response := response.ReplaceAll( String::NewLine(), '  ' );
    
    this.vhDoActionInfoReturn().Value( [String]duration
                                              + '|' + [String]issuccessful
                                              + '|' + response
                                              );
  *]
}
