ODI SDK: How to Automate Changes to 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. A separate post shows how to list all interfaces of the repository. Here we will focus on how to make changes in the interfaces and persist the changes 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.

The code provided here specifically looks for a known interface in a specific project and folder. You will have to update these for the code to work in your environment The expectation is that the staging area is set to "different from target" in the repository before the code is executed. The procedure will change the setting to the default (staging area on target).

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:

List Interfaces and Make Changes

Comments:

This is fantastic.

It should be possible to kick off an ODI tool through Groovy. Am I right? Can you point me in a direction?

Thanks
Uli

Posted by uli bethke on July 07, 2011 at 09:03 PM PDT #

It looks like the only way to invoke the ODI tools from Groovy would be through hte SDK. You will have to dynamically create a package, add an ODI command step and run the package (or generate a scenario and run the scenario).

Some of the classes that you will need are:
OdiPackage: to create the package, set the first step
StepOdiCommand: to create the step with the command, set the command expression
IOdiScenarioGenerator: to generate a scenario if needed
RunTimeAgent: to run the scenario locally
RemoteRunTimeAgentInvoker: to run the scenario on a remote agent

Posted by guest on July 08, 2011 at 12:24 AM PDT #

I have tried to put the pieces together in a separate post with code sample:
http://blogs.oracle.com/dataintegration/entry/leveraging_odi_tools_with_the
Enjoy!

Posted by Christophe Dupupet on July 08, 2011 at 09:17 AM PDT #

Wow. Thank you very much. I really need to familiarise myself with the SDK,

The options here are really limitless

Posted by uli bethke on July 08, 2011 at 04:11 PM PDT #

Hi there, I really appreciate on the tips posted. It’s really applicable. And that’s right, it’s good to have automation as it gives less time and effort.

Posted by Website Guru on August 03, 2011 at 05:22 PM 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