Search Results okc_template_usages




Overview

OKC_TEMPLATE_USAGES is a Contracts Core (OKC) transactional table in Oracle E-Business Suite 12.1.1 and 12.2.2 that stores the relationship between a terms template and the contract or document in which that template is used. It is the physical link between reusable template definitions and the actual contractual instruments generated or authored from them. Each row records one application of a template to a document, together with the numbering scheme, document type, effectivity information, and a set of administrative and behavioral control flags that govern how the resulting contract behaves.

From a Data Vault modeling perspective, the foreign key topology mined from the schema classifies this object heuristically as a link. Three foreign keys converge on the table — DOC_NUMBERING_SCHEME, DOCUMENT_TYPE, and TEMPLATE_ID — indicating that OKC_TEMPLATE_USAGES resolves many-to-many associations among templates, business document types, and numbering schemes while carrying descriptive attributes of its own.

Key Information Stored

The table is documented with 29 columns. The most significant are:

The documented unique index entries are internal LOB indexes (SYS_IL...), so no columns are formally documented as business-key candidates. Conventional EBS practice treats the combination of TEMPLATE_ID, DOCUMENT_ID, and DOCUMENT_TYPE as the effective business key. The documented structure does not enumerate a surrogate primary key column, though EBS tables of this family typically rely on a system-generated identifier in the document-identifier column group. Standard EBS audit columns — CREATION_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, and OBJECT_VERSION_NUMBER — are present.

Common Use Cases and Queries

Typical reporting needs include identifying which templates are in active use, tracing template provenance for a contract, and auditing which contracts bypassed standard terms.

  • Template usage frequency: group rows by TEMPLATE_ID and count DOCUMENT_ID to rank the most-used templates.
  • Contract-to-template lineage: join DOCUMENT_ID to the contract header tables to retrieve clause and article inheritance.
  • Control auditing: filter on LOCK_TERMS_FLAG = 'Y' or SOURCE_CHANGE_ALLOWED_FLAG = 'N' to find documents where terms were frozen at generation.
  • Integration reconciliation: use ORIG_SYSTEM_REFERENCE_CODE/ID1/ID2 to match external documents.

A representative query:

SELECT t.TEMPLATE_ID, t.DOCUMENT_ID, t.DOCUMENT_NUMBER, t.CONTRACT_SOURCE_CODE FROM OKC_TEMPLATE_USAGES t WHERE t.DOCUMENT_TYPE = :doc_type AND t.VALID_CONFIG_YN = 'Y' ORDER BY t.CREATION_DATE DESC;

Related Objects

The most significant related objects, based on the documented foreign key and dependency data, are:

  • OKC_TERMS_TEMPLATES_ALL — joined on OKC_TEMPLATE_USAGES.TEMPLATE_ID; holds template definitions.
  • OKC_BUS_DOC_TYPES_B — joined on DOCUMENT_TYPE; defines business document types.
  • OKC_NUMBER_SCHEMES_B — joined on DOC_NUMBERING_SCHEME; numbering scheme definitions.
  • OKC_K_HEADERS_ALL / OKC_K_HEADERS_B — contract headers keyed by DOCUMENT_ID.
  • OKC_K_LINES_ALL / OKC_K_ARTICLES_B — articles and lines inherited from the template.
  • OKC_TEMPLATE_DEVIATIONS — deviations recorded against template defaults.
  • FND_USER — resolves CREATED_BY, LOCKED_BY_USER_ID, CONTRACT_ADMIN_ID, and LEGAL_CONTACT_ID.