Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: User Defined Java Class Question

  1. #1
    Join Date
    Aug 2013
    Posts
    3

    Exclamation User Defined Java Class Question

    Hello ,

    Is there a technique or way to implement the feature of var trans_Status = SKIP_TRANSFORMATION; and var trans_Status = CONTINUE_TRANSFORMATION; or the features of initialize, execute and terminate available in modified java script plugin through the UDJC ( user defined java class ) plugin in Kettle 4.4.0 version.

    Thank You for the concern.

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by roypav View Post
    Is there a technique or way to implement the feature of var trans_Status = SKIP_TRANSFORMATION; and var trans_Status = CONTINUE_TRANSFORMATION;
    MJSV does I/O processing by itself, so you need something like trans_Status to control if a row should be written to the output channel or not.
    With UDJC all the I/O processing is done in your own code - you either write a row or let it be.
    What good would trans_Status be under such circumstances?

    Quote Originally Posted by roypav View Post
    or the features of initialize, execute and terminate available in modified java script plugin through the UDJC ( user defined java class ) plugin in Kettle 4.4.0 version.
    Sorry, this I don't understand at all.
    Both UDJC and MJSV offer preprocessing, processing, and postprocessing, although by different names.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Aug 2013
    Posts
    3

    Default

    Thank you very much. I do know how to do preprocessing, processing, and postprocessing using MJSV. Could you please let me know, how they are done in UDJC. In particular. i would like to execute a piece of code on the first row, a different piece for remaining rows and finally a different section of code on the last row. Similar to http://type-exit.org/adventures-with...entaho-kettle/ using UDJC.

    Thank you once again for offering help.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by roypav View Post
    Could you please let me know, how they are done in UDJC.
    When looking at the UDJC configuration dialog, expand the tree node Code Snippits / Common use. The top three samples should look familiar if you already know your way around MJSV.

    Quote Originally Posted by roypav View Post
    i would like to execute a piece of code on the first row, a different piece for remaining rows and finally a different section of code on the last row.
    No need for pre- and postprocessing , then. Reset the boolean variable "first" to false in order to restrict some code to the first row only. Step "Identify last row in a stream" should help you with the last row.
    So long, and thanks for all the fish.

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.