ODI SDK: Reporting on KM Use in Your Projects
By Christophe Dupupet on Jan 12, 2012
One common use for the ODI SDK is to generate reports leveraging the information that can be mined from the repository. One of our customers is actually comparing specifications from their analysts (normalized in an Excel spreadsheet) to the code for the mappings (found in the ODI repository) and reports on discrepencies between the two.
The example we have here is much simpler, but comes from a similar request from a different customer: how can you give developers the freedom to choose the KM they want in their interfaces, but ultimately validate that when they deviate from the corporate standards they justify their choices? In other words, how can I list which KMs are used (based on the source and target technologies) and report on deviations from the standard?
The code that we have here will parse a given project and folder, and will list the following for each interface:
- Interface name
- Target technology and associated CKM and IKM
- For each dataset, the list of source sets
- For each source set, the list of source technologies and associated LKM
In version 18.104.22.168 od ODI, you have to create an ODI procedure (using Groovy as the technology). You can then run this code against a standalone agent and the report will print in the agent console. Or you can adapt the code to print into a file (which is what you will want ultimately from a reporting perspective).
In version 22.214.171.124, you can run this code directly from the Groovy editor in the ODI studio, where you will see the printout. Unless, again, you'd rather modify the code to print into a file.
Here is a preview of a report generated in ODI 126.96.36.199 with this code: