Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Access Policy transformation
  6. Aggregator transformation
  7. B2B transformation
  8. Cleanse transformation
  9. Data Masking transformation
  10. Data Services transformation
  11. Deduplicate transformation
  12. Expression transformation
  13. Filter transformation
  14. Hierarchy Builder transformation
  15. Hierarchy Parser transformation
  16. Hierarchy Processor transformation
  17. Input transformation
  18. Java transformation
  19. Java transformation API reference
  20. Joiner transformation
  21. Labeler transformation
  22. Lookup transformation
  23. Machine Learning transformation
  24. Mapplet transformation
  25. Normalizer transformation
  26. Output transformation
  27. Parse transformation
  28. Python transformation
  29. Rank transformation
  30. Router transformation
  31. Rule Specification transformation
  32. Sequence transformation
  33. Sorter transformation
  34. SQL transformation
  35. Structure Parser transformation
  36. Transaction Control transformation
  37. Union transformation
  38. Velocity transformation
  39. Verifier transformation
  40. Web Services transformation

Transformations

Transformations

Defining input row behavior

Defining input row behavior

You can define the behavior of the Java transformation when it receives an input row. Define input row behavior in the On Input Row section of the Java editor. The Java code in this section executes one time for each input row.
Access and use the following input and output field data, variables, and methods in the On Input Row section:
Input field and output field variables
Access input and output field data as a variable by using the name of the field as the name of the variable. For example, if “in_int” is an integer input field, you can access the data for this field by referring as a variable “in_int” with the Java primitive data type int. You do not need to declare input and output fields as variables.
Do not assign a value to an input field variable. If you assign a value to an input variable in the On Input Row section, you cannot get the input data for the corresponding field in the current row.
Static variables and user-defined methods
Use any static variable or user-defined method that you declared in the Helper Code section.
For example, an active Java transformation has two input fields, BASE_SALARY and BONUSES, with an integer data type, and a single output field, TOTAL_COMP, with an integer data type. You create a user-defined method in the Helper Code section, myTXAdd, that adds two integers and returns the result.
Use the following Java code in the On Input Row section to assign the total values for the input fields to the output field and generate an output row:
TOTAL_COMP = myTXAdd (BASE_SALARY,BONUSES); generateRow();
When the Java transformation receives an input row, it adds the values of the BASE_SALARY and BONUSES input fields, assigns the value to the TOTAL_COMP output field, and generates an output row.
Java transformation API methods
You can call API methods provided by the Java transformation.

0 COMMENTS

We’d like to hear from you!