ODI SDK: Browsing The Repository to List All Interfaces

One of the most promising features of ODI 11g is its SDK that allows you to perform any action you want against the repository. A good introduction to the SDK is available here (and I used this as a starting point for my code)

One of our customers was asking for a way to perform massive changes (basically change the same parameter in all interfaces of the repository) and the best approach for this type of change is to leverage the ODI 11g SDK. First step: how to list all interfaces of the repository. In a separate post, we will see how to make these changes and persist them in the repository.

The approach here is to leverage both Groovy and the ODI SDK: Groovy gives us the ability to code in Java directly from within the ODI studio: no need to compile java code: I simply create an ODI procedure and run it.

A few notes of caution:

  • This code has been tested on ODI 11.1.1.5 and will not work with earlier releases of ODI.
  • You will need to update the code with your parameters to connect to your repository.
  • Make sure that you have a backup of your repository before you attempt any changes through SDK operations. A small mistake in automated operations can lead to massive headaches!
  • To see the output of the procedure, you will need a standalone agent: all the information is printed out to the console. I have no doubt that real developers will want to improve this and write out to something more convenient.

You will find the ODI procedure here. You should be able to import the procedure directly in one of your projects. If you have any issues with the import process, you will find the source code of the procedure here.

Sample result for the output in the agent console:

 Interfaces List

Comments:

Hi Christophe,

Nice Article.

Is it possible to provide the encoded Password in SDK instead of the password directly?
If not at present i believe Oracle should implement that for future release as not all clients will be willing to share their Repository password and we avoid that by sharing snps_login.xml .

Thanks
Kshitiz

Posted by guest on October 24, 2011 at 07:48 AM PDT #

Indeed, engineering is working on this.
Customer adoption of the SDK is much larger than initially anticipated (which is great news!) so we are working on these elements.

Posted by Christophe Dupupet on October 24, 2011 at 08:37 AM PDT #

Hi Christophe,
Great article.
Have you any code samples for sending the output of the procedure somewhere more convenient (not standalone agent console) as mentioned in your post..

Thanks,
Ray

Posted by guest on April 27, 2012 at 09:13 AM PDT #

Hi Ray

Where would you be interested in sending it? It can go just about anywhere.

Cheers
David

Posted by David on April 27, 2012 at 10:51 AM PDT #

David,
Thanks for the reply.
The plan would be to eventually have these Groovy jobs scheduled to run at night, so a record of the output (job stats, counts, useful messages) the following morning would be ideal. I was thinking maybe writing output to the large 'Error Message' text field in the definition tab of a completed job?? Does this make sense or would it be too difficult?

Cheers,
Ray

Posted by guest on May 01, 2012 at 08:12 AM PDT #

Ray,

Before writing back to the ODI logs, you want to carefully consider what you want to do with the information that you generate. Keep in mind that ODI logs should be purged on a regular basis to control the expansion of the repository. If you add your own entries to the logs, you will have to purge more often... and you will quickly lose the information you have added.

In addition, from a technical perspective, the APIS in the SDK that give access to the log will allow you to read, but not to write to the logs. (See here for an example of these APIs: https://blogs.oracle.com/dataintegration/entry/odi_sdk_retrieving_information_from). So writing to the logs will be more challenging.

By altering the code slightly though, you could write to a file, or if you are so inclined, you could add a little more code and write to your own tables. Again, the question is really how do you want to process the data. Some customers will use information gathered with the SDK in plain text reports, other will build complete Java applications that use the SDK to interact with the repository - then their own GUI offers a very fancy display. A middle ground between these two approaches is to write the information to a table (or a set of tables) and use your favorite reporting tool to format the information in a report.

I hope this helps

-Christophe

Posted by Christophe on May 01, 2012 at 10:20 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Learn the latest trends, use cases, product updates, and customer success examples for Oracle's data integration products-- including Oracle Data Integrator, Oracle GoldenGate and Oracle Enterprise Data Quality

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
3
5
6
7
8
9
10
12
13
14
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today