Package org.pentaho.actionsequence.dom.actions

Examples of org.pentaho.actionsequence.dom.actions.ResultSetCompareAction


  @Override
  protected boolean validateAction() {

    boolean actionValidated = true;
    ResultSetCompareAction compareAction = null;

    // get report connection setting
    if ( getActionDefinition() instanceof ResultSetCompareAction ) {
      compareAction = (ResultSetCompareAction) getActionDefinition();
      if ( compareAction.getResultSet1() == ActionInputConstant.NULL_INPUT ) {
        actionValidated = false;
        error( Messages.getInstance().getErrorString( "ResultSetCompareComponent.ERROR_0001_INPUT_RS1_UNDEFINED" ) ); //$NON-NLS-1$
      }

      if ( actionValidated && ( compareAction.getResultSet2() == ActionInputConstant.NULL_INPUT ) ) {
        actionValidated = false;
        error( Messages.getInstance().getErrorString( "ResultSetCompareComponent.ERROR_0002_INPUT_RS2_UNDEFINED" ) ); //$NON-NLS-1$
      }

      if ( actionValidated && ( compareAction.getCompareColumnNum() == ActionInputConstant.NULL_INPUT ) ) {
        actionValidated = false;
        error( Messages.getInstance().getErrorString( "ResultSetCompareComponent.ERROR_0003_COLUMN_UNDEFINED" ) ); //$NON-NLS-1$       
      }
    } else {
      actionValidated = false;
View Full Code Here


    // No cleanup necessary
  }

  @Override
  protected boolean executeAction() throws Throwable {
    ResultSetCompareAction compareAction = (ResultSetCompareAction) getActionDefinition();

    Object obj1 = compareAction.getResultSet1().getValue();
    if ( !( obj1 instanceof IPentahoResultSet ) ) {
      error( Messages.getInstance().getErrorString( "ResultSetCompareComponent.ERROR_0004_INPUT_RS1_NOT_RS" ) ); //$NON-NLS-1$
      return false;
    }

    Object obj2 = compareAction.getResultSet2().getValue();
    if ( !( obj2 instanceof IPentahoResultSet ) ) {
      error( Messages.getInstance().getErrorString( "ResultSetCompareComponent.ERROR_0005_INPUT_RS2_NOT_RS" ) ); //$NON-NLS-1$
      return false;
    }

    IPentahoResultSet rs1 = (IPentahoResultSet) compareAction.getResultSet1().getValue();
    IPentahoResultSet rs2 = (IPentahoResultSet) compareAction.getResultSet2().getValue();

    String tempOutputMismatches = compareAction.getOutputMismatches().getStringValue();
    boolean outputMismatches = false;
    if ( ( tempOutputMismatches != null ) && tempOutputMismatches.trim().toLowerCase().equals( "true" ) ) { //$NON-NLS-1$
      outputMismatches = true;
    }

    boolean stopOnError = false;
    String tempStopOnError = compareAction.getStopOnError().getStringValue();
    if ( ( tempStopOnError != null ) && tempStopOnError.trim().toLowerCase().equals( "true" ) ) { //$NON-NLS-1$
      stopOnError = true;
    }

    int compareCol = Integer.parseInt( compareAction.getCompareColumnNum().getStringValue() );

    return compareEquals( rs1, rs2, compareCol, outputMismatches, stopOnError );
  }
View Full Code Here

      return false;
    }
    boolean anyMismatches = false;
    boolean foundIt;
    Object srcValue = null, compValue = null;
    ResultSetCompareAction compareAction = (ResultSetCompareAction) getActionDefinition();
    IActionOutput output = compareAction.getOutputCompareResult();
    for ( int sourceRows = 0; sourceRows < sourceRowCount; sourceRows++ ) {
      foundIt = false;
      srcValue = rs1.getValueAt( sourceRows, compareCol );
      // n+1 traversal. This accommodates non-ordered input
      for ( int compRows = 0; compRows < compRowCount; compRows++ ) {
View Full Code Here

TOP

Related Classes of org.pentaho.actionsequence.dom.actions.ResultSetCompareAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.