Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IActionParameter


    startTest();
    IRuntimeContext context = run( "/test/rules/ResultSetExportTest.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn = context.getOutputParameter( "EXPORTRESULT" ); //$NON-NLS-1$
    assertNotNull( "Result is null", rtn ); //$NON-NLS-1$

    // Check that the data, Eastern, is in the result set
    String content = rtn.getStringValue();
    assertNotNull( "Exported content is null", content ); //$NON-NLS-1$

    int containsEastern = content.indexOf( "Eastern" ); //$NON-NLS-1$
    assertEquals( "ResultSet export does not contain 'Eastern'", Math.max( containsEastern, -1 ), containsEastern ); //$NON-NLS-1$
    finishTest();
View Full Code Here


        }
        IParameterManager paramMgr = context.getParameterManager();
        Map allParams = paramMgr.getAllParameters();
        Object valueObj;
        if ( allParams.containsKey( name ) ) {
          IActionParameter param = (IActionParameter) allParams.get( name );
          valueObj = param.getValue();
        } else {
          valueObj = context.getInputParameterValue( name );
        }
        if ( valueObj instanceof String ) {
          value = (String) valueObj;
View Full Code Here

    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/ipreparedcomponents/ipreparedcomponent_sql_available.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn );
    IPreparedComponent preparedComponent = (IPreparedComponent) rtn.getValue();

    assertNotNull( preparedComponent );

    finishTest();
  }
View Full Code Here

    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_available.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn );
    IPreparedComponent preparedComponent = (IPreparedComponent) rtn.getValue();

    assertNotNull( preparedComponent );

    finishTest();
  }
View Full Code Here

    IRuntimeContext context =
        run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_available_error_nodocument.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_FAILURE, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn );
    IPreparedComponent preparedComponent = (IPreparedComponent) rtn.getValue();

    assertNull( preparedComponent );

    finishTest();
  }
View Full Code Here

    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_preparelater.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn1 = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn1 );
    IPreparedComponent preparedComponent1 = (IPreparedComponent) rtn1.getValue();
    assertNotNull( preparedComponent1 );
    IPentahoResultSet resultset1 = preparedComponent1.executePrepared( null );
    assertTrue( resultset1.getRowCount() >= 1 );
    Object val1 = resultset1.getValueAt( 0, 0 );

    IActionParameter rtn2 = context.getOutputParameter( "second_prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn2 );
    IPreparedComponent preparedComponent2 = (IPreparedComponent) rtn2.getValue();
    assertNotNull( preparedComponent2 );
    HashMap map = new HashMap();
    map.put( "POSITIONTITLE", "Engineer" ); //$NON-NLS-1$ //$NON-NLS-2$
    IPentahoResultSet resultset2 = preparedComponent2.executePrepared( map );
    assertTrue( resultset2.getRowCount() >= 1 );
View Full Code Here

    runtimeContext.addTempParameter( name, param );
  }

  protected void addTempParameterObject( final String name, final Object paramObject ) {
    String pType = "object"; //$NON-NLS-1$
    IActionParameter actionParameter = new ActionParameter( name, pType, paramObject, null, null );
    addTempParameter( name, actionParameter );
  }
View Full Code Here

    info( "Expected: Successful execution with object available" ); //$NON-NLS-1$
    IRuntimeContext context = run( "/test/ipreparedcomponents/ipreparedcomponent_xquery_shareconn.xaction" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(
        Messages.getInstance().getString( "BaseTest.USER_RUNNING_ACTION_SEQUENCE" ), IRuntimeContext.RUNTIME_STATUS_SUCCESS, context.getStatus() ); //$NON-NLS-1$

    IActionParameter rtn1 = context.getOutputParameter( "prepared_component" ); //$NON-NLS-1$
    assertNotNull( rtn1 );
    IPreparedComponent preparedComponent1 = (IPreparedComponent) rtn1.getValue();
    assertNotNull( preparedComponent1 );
    IPentahoResultSet resultset1 = preparedComponent1.executePrepared( null );
    assertTrue( resultset1.getRowCount() >= 1 );
    Object val1 = resultset1.getValueAt( 0, 0 );
    assertNotNull( val1 );
View Full Code Here

  public String getOutput( final String name ) {
    if ( ( name == null ) || "default".equals( name ) || "".equals( name ) ) { //$NON-NLS-1$ //$NON-NLS-2$
      return outputStream.toString();
    } else {
      IActionParameter output = solutionEngine.getExecutionContext().getOutputParameter( name );
      return output.getStringValue();
    }
  }
View Full Code Here

  public IContentItem getOutputItem( final String outputName, final String mimeType, final String extension ) {

    // TODO support content output versions in the action definition

    IActionParameter outputParameter = getOutputParameter( outputName );
    if ( outputParameter == null ) {
      warn( Messages.getInstance().getErrorString(
          "RuntimeContext.ERROR_0021_INVALID_OUTPUT_REQUEST", outputName, actionSequence.getSequenceName() ) ); //$NON-NLS-1$
      return null;
    }

    String filePath = "~/workspace/" + FilenameUtils.getBaseName( getSolutionPath() ) + extension; //$NON-NLS-1$
    String contentName = "contentrepo:" + filePath; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$

    if ( !IActionParameter.TYPE_CONTENT.equals( outputParameter.getType() ) ) {
      warn( Messages.getInstance().getErrorString( "RuntimeContext.ERROR_0023_INVALID_OUTPUT_STREAM", outputName ) ); //$NON-NLS-1$
      return null;
    }

    try {
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.IActionParameter

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.