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. Aggregator Transformation
  4. Classifier Transformation
  5. Cleanse transformation
  6. Comparison Transformation
  7. Custom Transformation
  8. Custom Transformation Functions
  9. Consolidation Transformation
  10. Data Masking Transformation
  11. Data Masking Examples
  12. Decision Transformation
  13. Dynamic Lookup Cache
  14. Expression Transformation
  15. External Procedure Transformation
  16. Filter Transformation
  17. HTTP Transformation
  18. Identity Resolution Transformation
  19. Java Transformation
  20. Java Transformation API Reference
  21. Java Expressions
  22. Java Transformation Example
  23. Joiner Transformation
  24. Key Generator Transformation
  25. Labeler Transformation
  26. Lookup Transformation
  27. Lookup Caches
  28. Match Transformation
  29. Match Transformations in Field Analysis
  30. Match Transformations in Identity Analysis
  31. Merge Transformation
  32. Normalizer Transformation
  33. Parse transformation
  34. Rank Transformation
  35. Router Transformation
  36. Rule Specification transformation
  37. Sequence Generator Transformation
  38. Sorter Transformation
  39. Source Qualifier Transformation
  40. SQL Transformation
  41. Using the SQL Transformation in a Mapping
  42. Stored Procedure Transformation
  43. Standardizer Transformation
  44. Transaction Control Transformation
  45. Union Transformation
  46. Unstructured Data Transformation
  47. Update Strategy Transformation
  48. Verifier transformation
  49. Weighted Average Transformation
  50. XML Transformations

Transformation Guide

Transformation Guide

On Input Row Tab

On Input Row Tab

The Java transformation executes the Java code in the On Input Row tab when the transformation receives an input row. In this example, the transformation may or may not generate an output row, based on the values of the input row.
Enter the following code in the On Input Row tab:
// Initially set generateRow to true for each input row. generateRow = true; // Initially set isRoot to false for each input row. isRoot = false; // Check if input employee id and name is null. if (isNull ("EMP_ID_INP") || isNull ("EMP_NAME_INP")) {      incrementErrorCount(1);      // If input employee id and/or name is null, don't generate a output      // row for this input row.      generateRow = false; } else {      // Set the output port values.      EMP_ID_OUT = EMP_ID_INP;      EMP_NAME_OUT = EMP_NAME_INP; } if (isNull ("EMP_DESC_INP")) {      setNull("EMP_DESC_OUT"); } else {      EMP_DESC_OUT = EMP_DESC_INP; } boolean isParentEmpIdNull = isNull("EMP_PARENT_EMPID"); if(isParentEmpIdNull) {      // This employee is the root for the hierarchy.      isRoot = true;      logInfo("This is the root for this hierarchy.");      setNull("EMP_PARENT_EMPNAME"); } synchronized(lock) {      // If the employee is not the root for this hierarchy, get the      // corresponding parent id.      if(!isParentEmpIdNull)           EMP_PARENT_EMPNAME = (String) (empMap.get(new Integer (EMP_PARENT_EMPID)));      // Add employee to the map for future reference.      empMap.put (new Integer(EMP_ID_INP), EMP_NAME_INP); } // Generate row if generateRow is true. if(generateRow)      generateRow();

0 COMMENTS

We’d like to hear from you!