Using Substitution Methods



The methods that are accessible from the Knowledge Modules and from the procedures are direct calls to Oracle Data Integrator methods implemented in Java. These methods are usually used to generate some text that corresponds to the metadata stored into the Oracle Data Integrator repository.

Generic Syntax

The substitution methods are used in any text of a task of a Knowledge Module or of a procedure.
They can be used within any text using the following syntax
<%=java_expression%>
In this syntax:
·        The <%= %> tags are used to output the text returned by java_expression. This syntax is very close to the syntax used in Java Server Pages (JSP).
·        Java expression is any Java expression that returns a string.
The following syntax performs a call to the getTable method of the odiRef java object using three parameters. This method call returns a string. That is written after the CREATE TABLE text.
CREATE TABLE <%=odiRef.getTable("L", "INT_NAME", "A")%>
The Oracle Data Integrator Substitution API is implemented in the Java class OdiReference, whose instance OdiRef is available at any time. For example, to call a method called getFrom(), you have to write odiRef.getFrom().
Note:
For backward compatibility, the "odiRef" API can also be referred to as "snpRef" API. "snpRef" and "odiRef" object instances are synonyms, and the legacy syntax syntax snpRef.<method_name> is still supported but deprecated.

Specific Syntax for CKM

The following syntax is used in an IKM to call the execution of a check procedure (CKM).
This syntax automatically includes all the CKM procedure commands at this point of in the processing.
<% @ INCLUDE (CKM_FLOW | CKM_STATIC) [DELETE_ERROR] %>
The options for this syntax are:
·        CKM_FLOW: triggers a flow control, according to the CKM choices made in the Control tab of the Interface.
·        CKM_STATIC: Triggers a static control of the target datastore. Constraints defined for the datastore and selected as Static constraints will be checked.
·        DELETE_ERRORS: This option causes automatic suppression of the errors detected.
For example: the following call triggers a flow control with error deletion.
<% @ INCLUDE  CKM_FLOW DELETE_ERROR %>

Using Flexfields

Flexfields are user-defined fields enabling to customize the properties of Oracle Data Integrator' objects. Flexfields are defined on the Flexfield tab of the object window and can be set for each object instance through the Flexfield tab of the object window.
When accessing an object properties through Oracle Data Integrator' substitution methods, if you specify the flexfield Code, Oracle Data Integrator will substitute the Code by the flexfield value for the object instance.
For instance:
<%=odiRef.getTable("L", "MY_DATASTORE_FIELD", "W")%> will return the value of the flexfield MY_DATASTORE_FIELD for the current table.
<%=odiRef.getSrcTableList("", "[MY_DATASTORE_FIELD] ", ", ", "")%> will return the flexfield value for each of the source tables of the interface.
It is also possible to get the value of a flexfield through the getFlexFieldValue() method.
Note:
Flexfields exist only for certain object types. Objects that do not have a Flexfield tab do not support flexfields.

No comments:

Post a Comment