Table of Contents

Search

  1. Preface
  2. Introduction to Transformations
  3. Transformation Ports
  4. Transformation Caches
  5. Address Validator Transformation
  6. Aggregator Transformation
  7. Association Transformation
  8. Bad Record Exception Transformation
  9. Case Converter Transformation
  10. Classifier Transformation
  11. Comparison Transformation
  12. Consolidation Transformation
  13. Data Masking Transformation
  14. Data Processor Transformation
  15. Decision Transformation
  16. Duplicate Record Exception Transformation
  17. Expression Transformation
  18. Filter Transformation
  19. Hierarchical to Relational Transformation
  20. Java Transformation
  21. Java Transformation API Reference
  22. Java Expressions
  23. Joiner Transformation
  24. Key Generator Transformation
  25. Labeler Transformation
  26. Lookup Transformation
  27. Lookup Caches
  28. Dynamic Lookup Cache
  29. Macro Transformation
  30. Match Transformation
  31. Match Transformations in Field Analysis
  32. Match Transformations in Identity Analysis
  33. Normalizer Transformation
  34. Merge Transformation
  35. Parser Transformation
  36. Python Transformation
  37. Rank Transformation
  38. Read Transformation
  39. Relational to Hierarchical Transformation
  40. REST Web Service Consumer Transformation
  41. Router Transformation
  42. Sequence Generator Transformation
  43. Sorter Transformation
  44. SQL Transformation
  45. Standardizer Transformation
  46. Union Transformation
  47. Update Strategy Transformation
  48. Web Service Consumer Transformation
  49. Parsing Web Service SOAP Messages
  50. Generating Web Service SOAP Messages
  51. Weighted Average Transformation
  52. Window Transformation
  53. Write Transformation
  54. Appendix A: Transformation Delimiters

Developer Transformation Guide

Developer Transformation Guide

Example - Relational to Hierarchical Transformation

Example - Relational to Hierarchical Transformation

The Finance department of the Electronics Superstore company must process paychecks for company employees. They need to transform employee data stored in a relational database into a hierarchical format that their payment system can process.
The mapping needs to use a Relational to Hierarchical transformation that inputs employee details such as employee name, employee ID, employee address, and employee bank account data, and outputs the details in a usable hierarchical format.
In the relational input, the Bank_ID element is a primary key in the Employee table, and a Foreign key in the Bank table:
Employee_ID
Last_Name
First_Name
Address
Bank_ID
Bank_Account
9173327437
Sandrine
Jacques
74 Mobile Avenue
74845
8723487234
9174562342
Race
Tom
266 Crouse St.
9234734
45324734
8484526471
Jones
Charles
3815 LaValle Boulevard
389236
234638437
7023847265
Smith
Delilah
193 Short Drive
74845
8723463432
9174596725
Frederick
George
17 Serenity Road
9234734
6342636699
Bank_ID
Bank_Name
SWIFT_Code
74845
National Bank
9173327
9234734
International Bank
9174562
389236
Star National Bank
8484526
In the Payment output in hierarchical format, the elements are combined from the tables:
<banks> <bank name="National Bank" SWIFT="9173327"> <account id="8723487234"> <employee_id>9173327437</employee_id> <fname>Sandrine</fname> <lname>Jacques</lname> <address>74 Mobile Avenue</address> </account> <account id="8723463432"> <employee_id>9082745558</employee_id> <fname>Delilah</fname> <lname>Smith</lname> <address>193 Short Drive</address> </account> </bank> <bank name="International Bank" SWIFT="9174562"> <accounts> <account id="45324734"> <employee_id>5534398889</employee_id> <fname>Race</fname> <lname>Tom</lname> <address>266 Crouse St.</address> </account> <account id="6342636699"> <employee_id>9174596725</employee_id> <fname>Frederick</fname> <lname>George</lname> <address>17 Serenity Road</address> </account> </accounts> </bank> <bank name="Star National Bank" SWIFT="8484526"> <accounts> <account id="234638437"> <employee_id>8484526471</employee_id> <fname>Jones</fname> <lname>Charles</lname> <address>3815 LaValle Boulevard</address> </account> </accounts> </bank> </banks>
The following image shows the mapping in this example:
Create a mapping with relational input, hierarchical output, and a Relational to Hierarchical transformation.
The mapping contains the following objects:
Read_BankAccounts
The source that contains the bank data.
Read_Employees
The source that contains the employee data.
BankAccountsAndEmployees_To_PaymentsSystemXML
A Relational to Hierarchical transformation that transforms relational input that contains employee and bank account information into an XML format that the payment system consumes.
Write_BanksXML
A target path to the file that stores the transformed data every time you run the mapping.
The mapping uses the Read_BankAccount and Read_Employees files to provide relational input. The mapping processes and transforms the data with the BankAccountsAndEmployees_To_PaymentsSystemXML transformation. Then the mapping stores the output in the target path listed in the Write_BanksXML flat file.

0 COMMENTS

We’d like to hear from you!