Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: API: Setting conditional steps

  1. #1
    Join Date
    Nov 2013
    Posts
    5

    Default API: Setting conditional steps

    (If this thread does not belong in this forum, I'll happily move it. The developer forum seemed quite sparsely used, and this is about the specific Pentaho Data Integration API.)

    I'm having difficulty figuring out how to set the conditional step values for "Filter row" steps using the API. I can see how to create basic hops as links between steps, but I don't see how to set the values that indicate the correct step based on the filter. In the XML this is represented simply as:

    <send_true_to>Insert Transaction</send_true_to>
    <send_false_to>Update Transaction</send_false_to>

    I can see that these values are referenced in the FilterRowsData class, but I see no way to set them inside FilterRowsMeta or TransHopMeta.

    Any help would be greatly appreciated.

    Thanks,
    Curt

  2. #2
    Join Date
    Jun 2014
    Posts
    4

    Default

    Did you ever figure out how to do this Curt? I have the same question.

    It seems there used to be methods in FilterRowsMeta (setSendTrueStep and setSendFalseStep) that are not available in the current version of the API.

  3. #3
    Join Date
    Jun 2014
    Posts
    4

    Default

    I figured out how to do it after reviewing the source code for Spoon:

    //Configure filter to send target streams to appropriate destinations
    List<StreamInterface> targetStreams = filterRowsMeta.getStepIOMeta().getTargetStreams();


    for (StreamInterface streamInterface : targetStreams){
    switch (streamInterface.getStreamIcon()){
    case TRUE:
    streamInterface.setStepMeta(trueDestinationStepMeta);
    break;
    case FALSE:
    streamInterface.setStepMeta(falseDestinationStepMeta);
    break;
    default:
    //Disregard other target stream types
    break;
    }
    }
    Last edited by bcferreira; 09-30-2014 at 03:05 PM. Reason: formatting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.