Sunday 25 March 2012

Currencies

Here is the difference between document currency, local currency and global currencies:

1. Document Currency: is the currency in which actual transaction takes place. for e.g. if Apple buys hardware components from China the transaction will happen in Yuan Renminbi. so it becomes the document currency.

2. Local Currency: is the currency in which in a business unit closes its financial books. For e.g if Hyundai's manufacturing plant is in India and it orders parts from China, then the local currency of the transaction is INR while document currency is Yuan Renminbi.
Local currency is useful in cases where each business unit generates its own report in local currency.

3. Global Currency: is enterprise wide currency


Exchange Rate Types:


Saturday 10 March 2012

KM Research


ODI install comes with a set of xml files located at

ODI_HOME\oracledi\xml-reference

This location contains all the KMs that come bundled with ODI install, in the form of xml files.
Before using a KM in ODI the user has to explicitly import the appropriate KM from this location.

KMs are classified on the basis of tasks they perform.
KMs consist of steps, which are executed serially one after another. This modularizes the tasks performed
by a KM into small pieces each running independently of the other and preparing metadata for the next step.

A step usually consist of Substitution APIs which are java methods within single object instance odiRef. Substitution APIs
always return string. The same method returns different values based on the type of KM that invokes it.
snpRef and odiRef object instances are synonymous. snpRef object instance is the legacy syntax.
snpRef.<method> is supported but deprecated. (as oracle acquired sunopsis, snpRef was changed to odiRef)

Note: java code is invoked in tag <%=java_expression %>
The java_expression returns a string. The tag <%= %> distinguishes java code from rest of the code.


Flexfieds: flexfields are user defined fields and are added to customize properties of ODI objects.
Not all objects support flexfields(the ones which do not have flexfield tab do not support it).
Object properties can be accessed through ODI Substitution APIs. While accessing ODI object properties through
substitution APIs in KM steps when the flexfield CODE is specified replaces the CODE by the flexfield value for the object instance.
It is also possible to access the value of a flexfield through the method getFlexFieldValue().

Question: What is the difference between KM Options and Flexfields?
Answer: Apparently KM Options are set at the KM level. Whereas the flexfield is for an individual object instance.
research it further.

In order to understand the concept of Action Call Methods it is important to understand the terms:

Action, Action Line Code and Action Lines

It is important to understand the concept of Actions in ODI. An action represents one DDL command.
for e.g. Create table, Drop Table.  It is used to generate a ddl procedure(read script) that can be run on a
dataserver, to reflect the changes made to models in odi. An action can contain several Action Lines,
an Action Line can be defined as the sub commands required to perform a ddl operation. For e.g. dropping
a table requires dropping its constraints first.

Go to Topology Manger, the last navigator is Generic Actions, expand it, it lists all the generic actions available.
double click on action Create Table  :


click on dropdown in front of Type following type of actions can be seen:
Add
Begin
Modify
Create
Disable
Drop
Enable
End
Rename
Transfer



On the l.h.s the Action Lines are listed



The same Action Lines can also be seen by clicking on Details tab.
Click on any of the Action Lines, say Create Table, the code(Action Text) for that line can be seen:

This code can be edited by clicking on the Pencil button:


Note that for an action text both the Action Calls and odiRef methods are available. 

An Action Line has following properties:

Ignore Errors: select if you want to ignore errors when this command fails. for e.g dropping an non-existent table can be ignored. 
Commit: select if a commit is to be issued at the end of the command. 
Log level
Isolation level: odi help for details on this.
Transaction: Commands can be executed on several transactions numbered 0 to 9, otherwise choose Autocommit to work 
off-transaction.

Action group: Actions are organized into Action Groups. An Action Group corresponds to a given Syntax(Oracle, DB2 and so on).


Coming back to Action Calls Method,  the Action Call methods are usable only in Action Lines.  While Substitution APIs return text string, Action Call methods generate actions based on Context. As an e.g. in Create Table, the Action Line Add Primary Key has Action Call method  <% snpRef.addPK(); %> which generates add primary key action for each column defined as PK for current table. 

There should be only one Action Call method in an Action Line
there can't be more than one Action Call method in a Action Line:
for e.g in Action Create Table we've following 

<Only_One_Action_Call_In_A_Action_Line.bmp>

The syntax for calling the action call method is :

<% odiRef.method_name(); %>

Note: the Action Call method must be alone in an Action Line, should have no preceding = and should end with a semo colon