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. Chunking transformation
  9. Cleanse transformation
  10. Data Masking transformation
  11. Data Services transformation
  12. Deduplicate transformation
  13. Expression transformation
  14. Filter transformation
  15. Hierarchy Builder transformation
  16. Hierarchy Parser transformation
  17. Hierarchy Processor transformation
  18. Input transformation
  19. Java transformation
  20. Java transformation API reference
  21. Joiner transformation
  22. Labeler transformation
  23. Lookup transformation
  24. Machine Learning transformation
  25. Mapplet transformation
  26. Normalizer transformation
  27. Output transformation
  28. Parse transformation
  29. Python transformation
  30. Rank transformation
  31. Router transformation
  32. Rule Specification transformation
  33. Sequence transformation
  34. Sorter transformation
  35. SQL transformation
  36. Structure Parser transformation
  37. Transaction Control transformation
  38. Union transformation
  39. Vector Embedding transformation
  40. Velocity transformation
  41. Verifier transformation
  42. Web Services transformation

Transformations

Transformations

Defining helper code

Defining helper code

You can declare user-defined variables and methods for the Java transformation class in active or passive Java transformations. Define helper code in the Helper Code section of the Java editor.
After you declare variables and methods in the Helper Code area, you can use them in any code entry area except the Import Packages area.
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. 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 a Java transformation:
static int errorThreshold;
User-defined static or instance methods
These methods extend the functionality of the Java transformation. Java methods that you declare in the Helper Code section can use or modify output variables. You cannot access input variables from Java methods in the Helper Code section.
For example, use the following code in the Helper Code section 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!