ODI 11g – Interface Builder

In the previous blogs such as the one here I illustrated how to use the SDK to perform interface creation using various auto mapping options for generating 1:1 interfaces either using positional based matching, like names ignoring case and so on. Here we will see another example (download OdiInterfaceBuilder.java) showing a different aspect using a control file which describes the interface in simple primitives which drives the creation. The example uses a tab delimited text file to control the interface creation, but it could be easily taken and changed to drive from Excel, XML or whatever you wanted to capture the design of the interface.

The interface can be as complete or incomplete as you’d like, so could just contain the objects or could be concise and semantically complete.

The control file is VERY simple and just like ODI requests the minimal amount of information required. The basic format is as follows;

Directive Column 2 Column 3 Column 4 Column 5
source <model> <datastore>    
   can add many        
target <model> <datastore>    
mapping <column> <expression>    
   can add many        
join <expression>      
   can add many        
filter <expression>      
    can repeat many        
lookup <model> <datastore> <alias> <expression>
   can add many        

So for example the control file below can define the sources, target, joins, mapping expressions etc;

source    SCOTT    EMP
source    SCOTT    DEPT
target    STG_MODEL_CASE    TGTEMP
mapping    ENAME    UPPER(EMP.ENAME)
mapping    DNAME    UPPER(DEPT.DNAME)
mapping    DEPTNO    ABS(EMP.EMPNO)
join    EMP.DEPTNO = DEPT.DEPTNO
lookup    SCOTT    BONUS    BONUS    BONUS.ENAME = EMP.ENAME
filter    EMP.SAL > 1
mapping    COMM    ABS(BONUS.COMM)

When executed, this generates the interface below with the join, filter, lookup and target expressions from the file.

You should be able to join the dots between the control file sample and the interface design above.

So just like the initial post you will compile and execute the code, but use the different classname OdiInterfaceBuilder;

java –classpath <cp> OdinterfaceBuilder jdbc:oracle:thin:@localhost:1521:ora112 oracle.jdbc.OracleDriver ODI_MASTER mypwd WORKREP1 SUPERVISOR myodipwd STARTERS SDK DEMO1 <myinterfacecontrolfile.tab

The interface to be created is passed from the command line. You can intersperse other documentation lines between the control lines so long as the control keywords in first column don’t clash.

Anyway some useful snippets of code for those learning the SDK, or for those wanting to capture the design outside and generate ODI Interfaces. Have fun!

Comments:

See this posting from Michael who took the java and did a groovy implementation;
http://mverzijl.wordpress.com/2012/02/27/odi-11-1-1-6-working-with-groovy-editor/

Cheers
David

Posted by David on March 06, 2012 at 07:47 AM PST #

Hi,

I want to set UD1,UD2.. on target column and also want to use two tables join as Ordered join using SDK code.
Can any one suggest me on this.Any response is much appreciated.

Aniket

Posted by guest on May 03, 2012 at 10:04 PM PDT #

Hi There are classes for this, for example to set the UD indicators on a target column use this InterfaceActionOnTargetColumnSetUD, for the join use InterfaceActionOnGenericClauseSetOrder.

Cheers
David

Posted by David on May 04, 2012 at 08:39 AM PDT #

Thanks David for your reply.

Now i am able to create interface with column label property using SDK.
Can I execute objects using SDK ?I want to execute model(for reverse engineering )using SDK.
Please suggest on this.

Thanks,
Aniket

Posted by Aniket on May 17, 2012 at 11:44 PM PDT #

Hi Aniket

You will have to create a package with a model object etc and do the reverse using this - that's the only way.

Cheers
David

Posted by David on May 17, 2012 at 11:56 PM PDT #

Thanks David.
It means we can execute only scenarios.
Is there any way to generate scenario for existing package using SDK.I am not able to find solution for this.

Thanks,
Aniket

Posted by Aniket on May 18, 2012 at 12:03 AM PDT #

Hi Aniket

You can use OdiScenarioGeneratorImpl to generate the scenario;
http://odiexperts.com/generate-all-scenario-for-a-particular-project-using-odi-sdk/

Cheers
David

Posted by David on May 18, 2012 at 01:37 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

ETL, CDC, Real-Time DI and Data Quality for the Oracle Database from the inside.

Search

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