17 Using Component KMs

This chapter describes how to create and use 12c Component Knowledge Modules (KMs) in ODI. Knowledge Modules (KMs) are a collection of specific, reusable code templates that are designated to perform specific tasks in the overall data integration process. This feature provides easy-to-use set of SDK and UI interfaces that can be used to create and edit the 12c-style component KMs.

This chapter includes the following topics in detail:

17.1 Component KM Overview

A component KM is a KM that can be assigned to a component node in an ODI mapping. Component KMs are new since ODI version 12c. A component KM has the same functionality as any other KM, which includes tasks and options. Along with these options it also includes some added new functions. The currently available component-style KMs are Loading KMs, Integration KMs and Extract KMs.

Component KMs are like typical 11g IKM/LKM but with:

  • Component type (e.g. “DATASTORE”)

  • Component KM delegate class or groovy script

  • Source and target language fields at the KM and KM task level

  • A set of flow control commands

  • An ability to include a globally sharable code template snippet, known as a “global template

They are smart KMs that can create the substitution API objects – similar to odiRef and posses a unique property called KM Inheritance.

17.2 Understanding Inheritance

Component KM inheritance is a unique property of any component KM which allows a KM to inherit tasks, options, and field values from a base KM. Through this feature you can:

  • Create new Component KM & inherit its properties from base KM

  • Inherit specific set of KM task lines from base

  • Override base KM task lines

17.3 Writing Old Style KMs

Old style KMs refer to KMs that were created using the KM development framework available in the 11g version of ODI. 11g-style KMs are designed to use the monolithic odiRef substitution API object and syntax in their template commands. 11g LKM or IKM is a repository object that is used in conjunction with a 11g interface (which is similar to a 12c mapping) to customize code generation. But 11g KMs still work with 12c mappings. The LKM or IKM basically consists of certain connection and transaction settings, plus a set of KM tasks along with a source and target command template. The command template is the heart of the KM task functionality. The code generator performs template text substitution on each KM task command, and moves the substituted text into a session task that is executable and can be processed by the runtime agent. For code generation, the odiRef object acts as an AST object, and it is built automatically by the code generation framework..

17.4 Types of KMs

KMs are differentiated into following types, based on the listed categories:

  1. Mode of Creation

    Based on mode of creation, KMs are differentiated into two types. They are:

    • Seeded KMs - A seeded KM is a type of KM pre-installed into the ODI repository at the repository login time. Seeded KMs are read-only in the UI.

    • Non-Seeded KMs - A non-seeded KM is a type of KM that is created or imported by the user.

  2. Target and Source Languages

    Based on the target and source languages, KMs are divided into two types:

    • SQL KMs - SQL KMs are ones where the target or source language is SQL. They will generate SQL structured substitution API objects, and ultimately the LKM or IKM will generate SQL code

    • Non-SQL KMs - Non-SQL KM such as a Spark KM will generate a different language such as Python that will be used to load targets in the Spark service.

17.5 Creating and Editing Component KMs through KM Editor

Knowledge Module (KM) Editor is used to create, edit or customize your component KMs.
To create new component KMs,
  • Expand the Global Knowledge Modules or Projects node and right- click the required type of component KM that you wish to create and select New.

    For Example – To create a new IKM, right-click IKM node and select New Integration (IKM).

    The new knowledge module is created.

    Note:

    You cannot create an Extract KM (XKM) from Projects node.

To edit an existing component KM,

  • Double-click the required KM that you wish to edit or else right-click and select Open.

    The KM Editor gives you full control over all the aspects of the selected KM definition and implementation. This provides maximum flexibility to perform various operations related to the created KMs.

    Note:

    Seeded KMs open in the KM editor only in read-only mode and you cannot edit the properties of seeded KMs.

KM Editor has the following tabs for easy and effective administration of a KM. They are:

17.5.1 Working with Definition Tab

Definition tab of the KM Editor allows you to define or modify the essential properties of a newly created or existing component KM for its effective functioning. They are:

Note:

These properties vary based on the type of KM created.
  • Name – It represents the name of the newly created Knowledge Module (KM).

  • Type – It is a read-only field that is set based on the type of KM that is being created.

  • LKM Type – It specifies the basic type of LKM processing used to move data from one server to another.

    Note:

    This field appears in the user interface, only if the selected KM Type is LKM.

    Possible values of the field are:

    • None— No LKM type is defined.

    • Persistent Data Staging (PERSISTENT): The data is staged in some kind of persistent storage, for example a C$ staging table

    • Transparent Source Data Access (TRANSPARENT_SOURCE): Some mechanism is used to allow the source data to be transparently accessed by the target server. For Example: db link

    • Transparent Target Data Access (TRANSPARENT_TARGET): Some mechanism is used to allow the target datastore to be transparently loaded by the source server. For example: db link

    • Transparent Source and Target Access (TRANSPARENT_BOTH): Same as Transparent Target, except that the target IKM delegate and tasks are ignored.

  • Consistent Set Journalizing / Simple Journalizing Options – It represents the type of journalizing mode managed by the newly created KM. You can select between two modes- Consistent Set Journalizing or Simple Journalizing.

    Note:

    This field appears in the user interface, only if the selected KM Type is JKM.
  • Component Type- When a KM is set with a component type, then it becomes a 12c KM. For 11g KMs, this property is undefined. However this property cannot be set to undefined for a 12c KM.

    Note:

    This field is not applicable for JKM, SKM and RKM.
  • Base KM – It represents the KM that is selected as a base for the newly created KM. The newly created KM inherits tasks, options, and delegate class from the selected base KM. Note - There can be multiple levels of KM inheritance.

    Note:

    This field is not applicable for JKM, SKM and RKM.
  • Default KM for this pair of Technologies – When you select this check box, the newly created KM will be selected by default for the data servers with technologies shown in Source technology and Target Technology fields

  • Multi-Connections – When you select this check box, the newly created KM receives access to paired data servers, to exchange data loading between two data servers of different technologies, if required. For example, on procedure commands, you would be able to specify a command Select .... in one database and a command Insert into another database to transfer the whole result.

  • Oracle GoldenGate JKM with JAgent – It specifies the knowledge module as Oracle GoldenGate Knowledge Module to make visible JAgent configuration options in physical schema, logical schemas and models.

    Note:

    This field appears in the user interface, only if the selected KM Type is JKM.
  • Source Technology – It represents the source technology used by default on the procedure commands.

    Note:

    This field is enabled only when Multi-Connections field is configured for the newly created KM.
  • Target Technology – It represents the default technology to which the commands of the newly created KM will be addressed.

  • Source Language – It represents the language used for source extraction processing for XKM or LKM. For Example: SQL or PYTHON.

    Note:

    This field is enabled only when Multi-Connections field is configured for the newly created KM and is not applicable for JKM, SKM and RKM.
  • Target Language – It represents the language used for target load processing for LKM or IKM. For Example: SQL or PYTHON

    Note:

    This field is not applicable for JKM, SKM and RKM.
  • Command Text – It represents the actual code of the newly created KM.

    Note:

    This field appears in the user interface, only if the selected KM Type is SKM.
  • Generation Type – It represents the type of code generation processing that is done by the newly created KM. It corresponds to the basic functionality of the generator delegate class that is used by the KM. For Example: SQL to SQL agent row-by-row processing. This also corresponds to the type of AST object that is produced and tailored to render the generated code text that processes the data in the specified way.

    Note:

    This field is not applicable for JKM, SKM and RKM.
  • Source Generation Style – It represents the style of generation processing that will be done by this KM when it is used as an extract source. It corresponds to the AST producing method that will be called when the code generation source AST object is produced by this KM. The AST object is used to render text in the generated code. For Example: INSERT or UPDATE

    Note:

    This field is not applicable for JKM, SKM and RKM.
  • Target Generation Style – It represents the style of generation processing that will be done by this KM when it is used as a loading target. It corresponds to the AST producing method that will be called when the code generation target AST object is produced by this KM. The AST object is used to render text in the generated code. Examples: INSERT or UPDATE

    Note:

    This field is not applicable for JKM, SKM and RKM.
  • Description – It represents a detailed description of the newly created KM.

17.5.2 Working with Tasks Tab

KM tasks are the heart of any KM functionality. Each KM task (or KM line) consists of certain connection settings, plus a source and target command template. The command template is the heart of the KM task functionality. The code generator performs template text substitution on each KM task command, and moves the substituted text into a session task, which is an executable task that can be processed by the runtime agent.

This section elaborates on the following details of KM tasks:

17.5.2.1 Working with Toolbar of Tasks Tab

The Toolbar of the tasks tab allows you to effectively create and administer KM tasks. The toolbar includes the following options:
  • Search Dialog – Enter the required task name in the Search Dialog Search Dialog , to search for the required task in the task table

  • Expand All – Click the Expand All icon Expand All, to expand all the task groups present in the task hierarchy.

  • Collapse All – Click the Collapse All icon Collapse All, to collapse all the task groups present in the task hierarchy.

  • Add – Click the Add icon Add , to add a new task

  • Include Task – Include Task icon Include Task enables you to add the required lines of base KM. When you click the Include Task icon, include dialog appears displaying the available lines of base KM tasks to be included and thus enabling you to add the required line.

    Note:

    Include Task icon is enabled only when a line type is selected and the KM has Base KM set & there are some lines with the selected line type in Base KM.
  • Delete – Click the Delete icon Delete , to delete the newly added task

  • Exclude All Tasks – Exclude Task icon Exclude All Tasks, enables you to delete or remove all the included base tasks for the selected line type. When you click the Exclude All Tasks icon, all the base tasks are deleted for a given line type.

    Note:

    Exclude tasks button is enabled only if there are any manually included tasks or auto included tasks, when we set the base KM for a task.
  • Move Up – Click the Move Up icon Move Up , to move the required task up in the hierarchy list

  • Move Down – Click the Move Down icon Move Down , to move the required task down the hierarchy list

  • Move Task to Top – Click the Move Task to Top icon Move Task to Top, to move the required task to the top in the hierarchy list

  • Move Task to Bottom – Click the Move Task to Bottom iconMove Task to Bottom , to move the required task to the bottom in the hierarchy list

  • Select Columns – Click the Select Columns iconSelect Columns , to add the required task property to the displayed task table

17.5.2.2 Understanding the Properties of Tasks Tab of KM Editor

Tasks tab of the KM Editor allows you to define or modify the following properties of a newly created or existing component KM:
  • Task Hierarchy – It represents the hierarchical arrangement of defined KM tasks in a tree structure.

  • Ignore Errors – By enabling this option, the configured task is not interrupted in case if encountered with an invalid return code. If you select this check box and set it to true, then the KM task goes into "warning" instead of "error", and the execution of the task is not be stopped.

  • Execute Options – It represents the executable options of a task. When this option is set to:
    • Always Execute - This task will always be generated into the session or scenario task, and always executed in the session.

    • Execute Once - This task will only be generated once for each mapping execution unit, even if the execution unit contains multiple components that have the owning KM assigned. So for example, if there are 3 target datastore components in a certain execution unit, and they are all assigned to KM "IKM Multi-target Insert", and if the insert task in this KM has "execute once" as its execute option, then only the last-processed target datastore will generate the task.

    • Conditional Execute - This task will only be generated into the session or scenario if its associated conditional execution KM options are set to true. The conditional execution KM options can be set in the KM task property inspector window.

  • Source Command – It represents the lines of codes that you provide as source.

  • Target Command – It represents the lines of code generated in a native language or in a standard language (such as Groovy, SQL, PL/SQL, Transact-SQL, shell, and so forth). You can customize the source and target commands with the help of Template Expression Editor.

  • Source Technology – It represents the technology in which the source command is executed. Note: To use Oracle Data Integrator Tools (commands) in KM commands execution, set the technology to ODI Tools. To use OS commands or to execute external programs, set the technology to Operating System

  • Target Technology- It represents the technology on which the target command is executed. Note: To use Oracle Data Integrator Tools (commands) in KM commands execution, set the technology to ODI Tools. To use OS commands or to execute external programs, set the technology to Operating System

  • Source Language – It represents the source language selected in the Definition tab. This option enables you to set source language in the property inspector for all the KM tasks. You can also override the selected source language through this option.

  • Target Language- It represents the target language selected in the Definition tab. This option enables you to set target language in the property inspector for all the KM tasks. You can override the selected target language through this option.

  • Source Transaction – Through this option you can execute commands on several concurrent source transactions (numbered from 0 to 9) or work off-transaction by choosing the option Autocommit.

  • Target Transaction- Through this option you can execute commands on several concurrent target transactions (numbered from 0 to 9) or work off-transaction by choosing the option Autocommit.

  • Source Commit – If your command is being executed in a transaction (numbered 0 to 9), you can decide to continue or to commit the current source transaction according to the following modes:

    • No Commit: It means that the transaction is not committed. In this case, it can be committed in a later command. If a session ends normally, all transactions are committed by default.

    • Commit: The transaction is committed.

    • Commit 1000 rows: Oracle Data Integrator commits every 1000 records processed. This choice is only possible on a loading procedure command, that is, one containing a source command returning a result set and a destination command that carries out inserts.

  • Target Commit- If your command is being executed in a transaction (numbered 0 to 9), you can decide to continue or to commit the current target transaction according to the following modes:

    • No Commit: It means that the transaction is not committed. In this case, it can be committed in a later command. If a session ends normally, all transactions are committed by default.

    • Commit: The transaction is committed.

    • Commit 1000 rows: Oracle Data Integrator commits every 1000 records processed. This choice is only possible on a loading procedure command, that is, one containing a source command returning a result set and a destination command that carries out inserts.

  • Source Context- This field is used to override the default context setting in the owning KM. It represents the source execution context of the query. If you select the Execution context option, the command will be executed in the execution context chosen on launching or on the step.

  • Target Context – This field is used to override the default context setting in the owning KM. If the KM task has a target context setting, then that context will be used in conjunction with the execution logical schema, to determine the physical schema and thus connection information that will be used to execute the target command.

  • Source Logical Schema- It represents the logical schema for execution. The logical schema, linked to the source context, allows the physical execution schema to be defined.

  • Target Logical Schema- It represents the logical schema for execution. The logical schema, linked to the target context, allows the physical execution schema to be defined.

  • Source Transaction Isolation – It represents the source transaction isolation level for selected orders. The isolation levels shown are those of the SQL ISO. They are not supported by all data servers. The levels of isolation are:

    • Default: The transaction keeps the connection's isolation level.

    • Read Uncommitted: The transaction can read data not committed by another transaction.

    • Read Committed: The transaction can only read data committed by other transactions (in general, this is the default mode of many data servers).

    • Repeatable Read: The transaction is certain to read the same information if it executes the same SQL query several times, even if the rows have been modified and committed by another transaction in the meantime.

    • Serializable: The transaction is certain to read the same information if it executes the same SQL query several times, even if the rows have been modified, deleted, or created and committed by another transaction in the meantime.

  • Target Transaction Isolation- It represents the target transaction isolation level for selected orders. The isolation levels shown are those of the SQL ISO. They are not supported by all data servers. The levels of isolation are:

    • Default: The transaction keeps the connection's isolation level.

    • Read Uncommitted: The transaction can read data not committed by another transaction.

    • Read Committed: The transaction can only read data committed by other transactions (in general, this is the default mode of many data servers).

    • Repeatable Read: The transaction is certain to read the same information if it executes the same SQL query several times, even if the rows have been modified and committed by another transaction in the meantime.

    • Serializable: The transaction is certain to read the same information if it executes the same SQL query several times, even if the rows have been modified, deleted, or created and committed by another transaction in the meantime.

  • Log Counter – It logs which counter (Insert, Update, Delete or Errors) records the number of rows processed by this command.

  • Log Level- It represents the logging level of the command. At execution time, commands can be kept in the log based on their log level.

  • Log Final Command – Select to log final code for source and target commands. This improves the readability of logs which have a lot of runtime parameters. Use this option only for tasks that do not contain passwords or other sensitive data.nad

  • Owner – This field represents the name of the KM from which the editable task originates from. If the Owner is a base km, then the task becomes read only. If a base km task is overridden in an inheriting KM, then the Owner becomes the inheriting KM.

17.5.2.3 Exploring Source/Target Command Editor

Source/ Target Command Editor is one of the key factors of KM Customization.

Note:

Source/Target Command Editor is invoked when a task is highlighted, and a source or target command for the task is edited.

To launch the editor,

Select the required task from the hierarchy and then click the editor icon Editor icon of the selected task

The Edit Source/Target Command editor is launched, allowing you to edit the required changes in the source/target commands.

Advantages of using Source/Target Command Editor are:
  • Auto – Code Completion - It displays the full template command that is used by the code generator to produce the generated text.

  • In scope Object Trees - It displays the reusable templates that are used by the overall template command, to encourage template reuse.

  • Richer substitution API

  • New flow control syntax

  • User-defined groovy substitution variable definition script

Features of Source/Target Command Editor

Significant features of the editor are:
  1. Code Folding – This unique feature of the editor allows you to expand or collapse sections of the code, using an expand/collapse button that is contained in a margin area at the left-hand side of the text displayed in the editor. If global reusable templates are used in the template command, then they are shown as expandable text sections in the editor, with an associated expand/collapse button.

    Note:

    The global reusable template is used by including it in the template command using #INCLUDE command
    Another sub feature of the code folding feature is to allow the user to either delete a sub template include that is no longer wanted, or revert an overridden sub template to its previous global sub template text.
    • To do this, right-click the popup menu that is available when the mouse is over a code folding expand or collapse button, as shown:Description of GUID-45D381EF-BC85-4196-9DCF-5C78079BF15B-default.png follows
      Description of the illustration GUID-45D381EF-BC85-4196-9DCF-5C78079BF15B-default.png

    • Delete Include – When you select the Delete Include option, then the selected sub template INCLUDE statement is deleted from its parent sub template, and the parent sub template is marked as overridden by the local KM, because it no longer contains the deleted INCLUDE statement.

      When the sub-template text is collapsed containing the INCLUDE statement, cannot be edited or selected in the editor. If you wish to change the INCLUDE statement, possibly to include a different sub-template, then you must delete the current INCLUDE statement using the right-click Delete INCLUDE menu item and then add a new INCLUDE statement. The new include statement will not show as expandable unless the editor is closed and re-opened.

    • Revert Local Override - When you select the Revert Local Override option, then the selected sub template text will revert to the template text of the global shared template that was included, if it has been overridden.

    Note:

    This menu item is enabled only if the selected template has been changed and thus overridden by the local KM task.
  2. Highlight Text – This feature provided two levels of highlighting in the expanded template. They are:

    • Yellow highlighting - The yellow highlighting is language highlighting, in this case highlighting keywords for the SQL language.

    • Blue Highlighting - The blue highlighting is for the new 12c template flow control syntax.

      These commands allow conditional generation of text, or looped generation of text, similar to what was done with java code in 11g.

  3. New Template Command (NL) – The editor also provides a new 12c template command #NL# which will cause the generator to generate a new line character. By using this command, the new lines in the template are ignored, which allows the template to be better formatted without any regards to the generated code.

Understanding Source/Target Command Editor Tabs

The left pane of the Source/Target Command Editor has four tabs enabling you to work on groovy variable substitution scripts and syntax validation results. Each tab has a specific function to perform. They are:
  1. Command Text: This tab displays the main template command that is used to generate code.

  2. Groovy Task-local: This tab displays a groovy script containing substitution variable definitions usable by this task only.

  3. Groovy KM Local: This tab displays a groovy script containing substitution variable definitions usable by any task present in this KM.

    The KM task groovy variable definition text has its own panel in the template text editor panel. Groovy language highlighting will be applied to the groovy panels. The user may define new variables inside the text that can be used as substitution variables inside the template text. They may also navigate into the Abstract Syntax Tree (AST) to find source or intermediate AST objects, and add new methods to those objects.

  4. Validation Results: This tab displays the result for the most recent syntax validation execution. It displays Syntax validation for both template and groovy substitution variable definition scripts.

Working with Toolbar of Source/ Target Command Editor

The Task pane of the Source/Target Command editor possesses the following icons, enabling you to perform various code editing operations:
  • Undo

  • Redo

  • Cut

  • Copy

  • Paste

  • Language Selection List – It represents the language selection list box. The contents of the editor are highlighted in the selected language.

    Note:

    If the target language is not set in the Tasks tab, then the Source/Target Command editor lists all the available languages.
  • Highlight the whole expression list box – It is used to highlight the various types of code expressions, such as:

    • Whole Expression

    • % Phase

    • ? Phase

    • $ Phase

    • @ Phase

  • Expand all

  • Collapse all

  • Validate Syntax – Allows to validate the syntax of the code

  • Search icon in the Search text box – Allows you to search for the required line of code through the entered keyword

17.5.3 Working with Options Tab

KM editor provides you the flexibility to use base KM options in the extended KM. The Options tab of the KM editor displays all the available base KM Options and groups in an order based on their inheritance hierarchy. Hence, options from the base KM will be displayed first in the hierarchy, followed by the options of the derived KMs.

Note:

Options tab is not available for SKMs.

Properties of Options Tab

Options tab of the KM Editor allows you to define or modify the following properties of a newly created or existing component KM:
  • Name – It represents the name of the option.

    Note:

    It is recommended to name an option in a combination of upper case with underscores. For Example – CREATE_TARGET_TABLE
  • Type – It represents the datatype of the option. Valid values of this field are:

    • Boolean - Boolean options can be set to true or false.

    • Choice - A choice option allows you to choose the option value from a pre-defined list of option values. You can edit these values using the Edit Choice Dialog. Click the browse icon , to launch the Edit Choice Dialog. It allows you to add or delete the required choice item

    • Text - Text options can hold an alphanumeric value of unlimited length and are parsed for variable and sequence references.

    • Value - Value options can hold an alphanumeric value up to 250 characters

  • Default value – It represents the default value of the selected options

  • Condition Expression – It allows you to set the required condition for the selected option. Double-click the field for editing the condition expression for the selected option. Click the browse icon Browse icon, to launch the Edit Expression Editor, which enables you to create or edit the existing groovy script that determines whether a knowledge module should be enabled, disabled, displayed or hidden.

  • Owner – It represents the name of the KM that owns the created option. This field helps you to identify the base options, as you cannot edit the base options.

  • Description – It represents the single line description of the created option that is displayed in the ODI user interface.

  • Help – It allows you to create keywords that can help you while working with options. Double-click the field for changing the value for the selected option. Click the browse iconBrowse icon, to launch the Chang Value dialog, which enables you to create or edit the help content for the selected options.

Working with Toolbar of Options Tab

The toolbar of the Options Tab, allows you to perform the essential functions through the following options:
  • Search Dialog – Enter the required option name in the Search DialogSearch Dialog , to search for the required option displayed in the Options table

  • Expand All – Click the Expand All iconExpand All , to expand all the option groups present in the Options hierarchy.

  • Collapse All – Click the Collapse All iconCollapse All , to collapse all the option groups present in the Options hierarchy.

  • Add – Click the Add iconAdd icon , to add a new option or option group

  • Delete – Click the Delete iconDelete icon , to delete the newly added option or option group

  • Move Up – Click the Move Up iconMove Up icon , to move the required option up in the hierarchy list

  • Move Down – Click the Move Down iconMove Down icon , to move the required option down the hierarchy list

    Note:

    Base Options cannot be moved up or down in the Options hierarchy table.
  • Move Out – Click the Move Out iconMove Out icon , to move the required option out of the selected option group

  • Move In – Click the Move In iconMove In icon , to move the required option inside the selected option group

    Note:

    You cannot move options to a base group, as its move arrows are disabled.
  • Move Option to Top – Click the Move Option to Top iconMove Option to Top icon , to move the required option to the top in the hierarchy list

  • Move Option to Bottom– Click the Move Option to Bottom icon Move Option to Bottom icon, to move the required option to the bottom in the hierarchy list

  • Select Columns –Click the Select Columns iconSelect Columns icon , to add the required option property to the displayed Options table

17.5.4 Working with Version Tab

KM editor allows you to save different versions of knowledge modules that were created for future reference. A version is a customized piece of code that you had created sometime and you can save it and reuse it whenever required. A version serves as a track record of all the changes and it also allows you to reuse or restore the required changes. These versions are saved in the master repository of the ODI object.

Properties of Version Tab

Version tab allows you to manage the various versions of the knowledge modules present in ODI and it allows you to view and update the following details:
  1. Creation and Update Information – This node displays you the details of the user who created or updated the knowledge module along with their date and time of creation or updation.

    • Created By – It represents the name of the user who created the knowledge module

    • Created On – It represents the date and time at which the knowledge module was created

    • Updated By- It represents the name of the user who recently updated the details of the knowledge module

    • Updated On- It represents the date and time at which the knowledge module was recently updated

  2. Information – This node displays the following details:

    • Internal ID – The internal ID is a unique property for the object type within a repository. It is called a unique property because it contains the unique repository ID which enables object identification.

    • Global ID – It represents the unique global ID of the created/modified knowledge module

    • Build Number – It represents the build number which is used to track the internal product release

    • Customization Status – It represents the status of customization that had happened to the selected knowledge module. It can be:

      1. Oracle Genuine – This status denotes that the selected knowledge module is a non-modified original knowledge module provided by Oracle.

      2. Modified By User – This status denotes that the selected knowledge module is an original knowledge module provided by Oracle that has been modified by the user.

      3. Non-Oracle – This status denotes that the selected knowledge module is a non-oracle knowledge module.

  3. Versions — This node lists complete details of the available versions of the knowledge modules in a table which includes the following details:

    • Version – It represents the version number of the created object

    • Date – It represents the date in which the version was created

    • User – It represents the name of the user who created the version

    • Description – It displays the details of the created version

Exploring Task icons of Versions table

The Task toolbar allows you to perform the following operations with regards to the available versions of knowledge module:

  • Create a New Version – It is used to check-in a new version of the selected object. Click the Add iconAdd icon present in the task toolbar, to create a new version of the object. Versioning dialog appears, allowing you to update the following details of the created version:

    1. Version Number – Auto generated by the application

    2. Description – Provide a short description of the created version

    3. Previous Versions – Lists complete details of all the available previous versions

  • Delete a Version – It is used to delete any version that is not required. Click the Delete iconDelete icon present in the task toolbar, to delete any existing version of the object.

  • Restore a Version – It is used to restore the object to any previously existing version. Click the Restore iconRestore Version icon present in the task toolbar, to restore to any existing previous version of the object.

  • Export a Version- It is used to export the object details. Click the Export iconExport Version icon present in the task toolbar, to export the details of an existing version of the object.

17.6 Understanding Global Templates

Global Templates are shared customized templates that are either newly created or copied from a local knowledge module task command template. These templates can be used in KM tasks for any KM and they can be used inside source or target expressions of Component KM Lines. The Global shared templates appear under the Global Templates node present under the set of global object trees in the navigator.

There are two types of global templates.

  • Seeded Global Templates — Seeded templates are read-only templates, available to use as is or can be duplicated and edited if required.

  • User Created Templates — These templates can be customized as required.

To access global templates,

This section elaborates on the following:

17.6.1 Creating and Editing Global Templates

You can work on global templates with the help of template editor. It allows you to create new global templates or edit the details of the existing global templates.

To create new global templates,

  • Right-click the Global Templates node and select the New Template option

    The new global template is created.

To edit the existing global templates,
  • Expand the Global Templates node, to view the list of available global templates

    All the available global templates are grouped into specific language groups and listed.

  • Expand the required language node, to view all the global templates available for the selected language. For Example – Expand the Groovy node, to view all the global templates related to groovy

    Note:

    Once you change the language of a template and save it, it is moved under the new language group.
  • Double-click the required global template, to edit its details.

    Note:

    Seeded Templates cannot be edited and are opened only in read-only mode.

17.6.2 Using Template Editor

Template Editor allows you to create new global templates or edit the details of the existing global templates. The Template Editor essentially has the following tabs:

  • Definition Tab

  • Version Tab

Working with Definition Tab

Definition Tab of the Template Editor allows you to define or modify the key properties of a global template. They are:
  • Name – It represents the name of the global template

  • Technology – It lists all the available technologies for the new global template. You can select the required technology from the list or select the generic option - Any Technology

  • Language – It lists all the available languages derived from the selected technology for the new global template. You can select the required language from the list or select the generic option - Any Language

    Note:

    If you try to create a new template from an existing template or a language name node, the template editor language field will be set to that language by default. However, if you try to create a new template from global level, language will be set to the first one in the list by default.
  • Template Text – It represents the template editing area, which allows you to add or edit the template code, in plain text format only. If you require advanced editing options or syntax highlighting and need access to the built-in variables or odiRef function then click the edit icon Edit icon present at the top-right corner of the Template Text box. The Edit Template Text Editor opens, allowing you to perform the required operations/functions. This editor has two tabs:

    • Command Text — This tab displays the main template command that is used to generate code.

    • Validation Results — This tab displays the result for the most recent syntax validation execution.

Working with Version Tab

Version Tab of the Template Editor provides a track record of all the changes happening in the editor. It logs the complete details of template creation and modification in different versions, thereby enabling us to easily track the operations performed in the global templates or revert to the required version.

Version tab allows you to manage the following details of global templates:
  1. Creation and Update Information – This node displays you the details of the user who created or updated the global template along with their date and time of creation or updation.

    • Created By – It represents the name of the user who created the global template

    • Created On – It represents the date and time at which the global template was created – It represents the date and time at which the global template was created

    • Updated By- It represents the name of the user who recently updated the details of the global template

    • Updated On- It represents the date and time at which the global template was recently updated

  2. Information – This node displays the following details:

    • Internal ID – The internal ID is a unique property for the object type within a repository. It is called as a unique property because it contains the unique repository ID which enables object identification.

    • Global ID – It represents the unique global ID of the created/modified global template

17.6.3 Working with Context Menu Items for Global Templates

Right-click any existing global template, listed under the language node, to work on the following context menu items of the global template:

Note:

These options may vary based on the type of template — Seeded or User Created templates.
  • Open – Select Open, to open the selected global template in the template editor, aiding further operations

  • View – Select View, to view the details of the selected global template in read-only mode

  • New – Select New, to create a new global template in the same language of the selected template

  • Duplicate Selection – Select Duplication Selection, to duplicate the details of the selected global template

  • Delete – Select Delete, to delete the template that is not required

  • Version - Select this option to version the selected global template:

    • Add to VCS

    • Version History

    • Restore from VCS

    • Create VCS Version

  • Import – Select Import -> Import Templates, to import the required details from some other template to the required template. Import Templates dialog appears, allowing you to select the following import details:

    • Import Type – Select the required type of import which can be Duplication, Synonym Mode Insert, Synonym Mode Update and Synonym Mode Insert and Update

    • File Import Directory – Browse for the location of the template from which you wish to import the template details

    Templates under the selected directory appear, allowing you to select the required templates for import.

  • Export – Select Export, to export existing details of the selected template to the required location. Export dialog appears, allowing you to select the following export options:

    • Export to Directory – Location to which you wish to export the template details

    • Export Name – Name of the exported template

    • Encryption Information – Provide details on the Export Key

    • Advanced Options - It includes XML Version, XML Character Set and Java Character Set details

  • Compare with Export File – Select this option, to compare the exported template with the current template

    Note:

    This option is available only for XKMs.
  • Edit Memo – Select this option, to edit the details of the Memo tab of the required global template

  • Assign To – Select Assign To, to assign the selected global template to some other user

  • Locks – Select to Lock or Unlock the selected global template

  • Expand – Select Expand, to display all the elements of the node

  • Collapse – Select Collapse, to collapse all the displayed elements of the node