Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Working with Transformations
  3. Address Validator Transformation
  4. Aggregator Transformation
  5. Association Transformation
  6. Bad Record Exception Transformation
  7. Case Converter Transformation
  8. Classifier Transformation
  9. Cleanse transformation
  10. Comparison Transformation
  11. Custom Transformation
  12. Custom Transformation Functions
  13. Consolidation Transformation
  14. Data Masking Transformation
  15. Data Masking Examples
  16. Decision Transformation
  17. Duplicate Record Exception Transformation
  18. Dynamic Lookup Cache
  19. Expression Transformation
  20. External Procedure Transformation
  21. Filter Transformation
  22. HTTP Transformation
  23. Identity Resolution Transformation
  24. Java Transformation
  25. Java Transformation API Reference
  26. Java Expressions
  27. Java Transformation Example
  28. Joiner Transformation
  29. Key Generator Transformation
  30. Labeler Transformation
  31. Lookup Transformation
  32. Lookup Caches
  33. Match Transformation
  34. Match Transformations in Field Analysis
  35. Match Transformations in Identity Analysis
  36. Merge Transformation
  37. Normalizer Transformation
  38. Parser Transformation
  39. Rank Transformation
  40. Router Transformation
  41. Sequence Generator Transformation
  42. Sorter Transformation
  43. Source Qualifier Transformation
  44. SQL Transformation
  45. Using the SQL Transformation in a Mapping
  46. Stored Procedure Transformation
  47. Standardizer Transformation
  48. Transaction Control Transformation
  49. Union Transformation
  50. Unstructured Data Transformation
  51. Update Strategy Transformation
  52. Weighted Average Transformation
  53. XML Transformations

Transformation Guide

Transformation Guide

Defining Helper Code

Defining Helper Code

On the
Helper Code
Helpers
tab, you can declare user-defined variables and methods for the Java transformation class in active or passive Java transformations.
After you declare variables and methods on the
Helper Code
Helpers
tab, you can use the variables and methods on any code entry tab except the
Import Packages
Imports
tab.
On the
Helper Code
Helpers
tab, you can declare the following types of code, variables, and methods:
  • Static code and static variables.
    Within a static block, you can declare static variables and static code. All instances of a reusable Java transformation in a mapping
    and all partitions in a session
    share static code and variables. Static code runs before any other code in a Java transformation.
    For example, the following code declares a static variable to store the error threshold for all instances of a Java transformation in a mapping:
    static int errorThreshold;
    Use this variable to store the error threshold for the transformation and access it from all instances of the Java transformation in a mapping
    and from any partition in a session
    .
    You must synchronize static variables
    in a multiple partition session or
    in a reusable Java transformation.
  • Instance variables.
    You can declare partition-level instance variables.
    Multiple instances of a reusable Java transformation in a mapping
    or multiple partitions in a session
    do not share instance variables. Declare instance variables with a prefix to avoid conflicts and initialize non-primitive instance variables.
    For example, the following code uses a boolean variable to decide whether to generate an output row:
    // boolean to decide whether to generate an output row // based on validity of input private boolean generateRow;
  • User-defined static or instance methods.
    Extends the functionality of the Java transformation. Java methods declared on the
    Helper Code
    Helpers
    tab can use or modify output variables or locally declared instance variables. You cannot access input variables from Java methods on the
    Helper Code
    Helpers
    tab.
    For example, use the following code on the
    Helpers
    tab to declare a function that adds two integers:
    private int myTXAdd (int num1,int num2) {      return num1+num2; }

0 COMMENTS

We’d like to hear from you!