Search Results restore_doc_version




Overview

OKC_TERMS_VERSION_PVT is a private PL/SQL package in the APPS schema that provides the internal versioning engine for Oracle E-Business Suite Contracts (OKC) terms and conditions. It is part of the Oracle Contracts Core module within the ETRM (Enterprise Contracts) product family and carries a VALID status in both Oracle EBS 12.1.1 and 12.2.2. The package is classified as a PVT (private) API, meaning it is intended to be called by other Oracle-owned packages rather than directly by customer code or external integrations.

The business purpose of OKC_TERMS_VERSION_PVT is to manage the lifecycle of document versions associated with contract terms, sections, and articles. Contracts frequently undergo amendment, renegotiation, or redlining, and each change may warrant preservation of the prior state. This package creates, restores, and deletes those versioned document snapshots, and clears amendment markers so that subsequent changes can be tracked cleanly.

Key Procedures and Functions

The ETRM metadata documents four procedures or functions within this package:

  • CLEAR_AMENDMENT — Removes or resets amendment indicators on the affected terms version records after an amendment cycle has been completed or abandoned, ensuring that unrelated edits are not erroneously flagged as amendments.
  • VERSION_DOC — Creates a new version of the terms document, capturing the current state of articles, sections, and related rows so that the prior revision remains retrievable.
  • RESTORE_DOC_VERSION — Reinstates a previously stored document version, rolling the contract's terms content back to an earlier revision.
  • DELETE_DOC_VERSION — Removes a stored document version when it is no longer required, typically during cleanup or when a draft version is discarded.

Parameter signatures are not exposed in the ETRM metadata and should be confirmed against the package specification in the target environment before use. The procedures are designed for coordinated internal invocation, and callers must supply valid version identifiers, document identifiers, and the appropriate WHO-column context.

Tables Accessed

The package reads and writes the following tables through APPS synonyms:

  • OKC_ARTICLES_ALL — Stores article records belonging to contract terms documents; versioning logic inserts or clones article rows here.
  • OKC_K_ARTICLES_B — Holds the base table definition for articles, providing the underlying key structure used during version capture and restore.
  • OKC_SECTIONS_B — Stores section definitions that group articles; sections are versioned alongside their child articles to preserve document hierarchy.
  • OKC_TEMPLATE_USAGES — Tracks which templates were applied to a terms document; retained so that restored versions maintain template provenance.
  • DUAL — Used for scalar evaluations and date or sequence lookups.

Usage Notes

OKC_TERMS_VERSION_PVT is not intended for direct customer invocation. The ETRM dependency report shows it is referenced by the public group package OKC_TERMS_VERSION_GRP, by OKC_REP_CONTRACT_PROCESS_PVT, and by itself. These callers are typically driven by the Contract Terms and Conditions forms, amendment workflows, or the Contracts repository processing logic. Developers extending Contract Terms functionality should call OKC_TERMS_VERSION_GRP rather than this private package, and should verify signature compatibility across 12.1.1 and 12.2.2, since the metadata indicates no public API contract is published for OKC_TERMS_VERSION_PVT.