Search Results okc_terms_copy_pvt




Overview

OKC_TERMS_COPY_PVT is a private (PVT) PL/SQL package in the APPS schema that provides the internal copy engine for Oracle E-Business Suite contracts and terms content. It belongs to the Enterprise Contracts (OKC / ETRM) product family and is invoked by the public terms and contract authoring APIs when clauses, articles, templates, and structured terms must be duplicated from a source document to a target document. The package centralizes the complex logic required to reproduce terms structures — article hierarchies, variable bindings, version history, and adoption records — without forcing callers to manipulate the underlying OKC tables directly. Because it is classified as PVT, it is not a supported public integration point; Oracle exposes higher-level wrappers, and this package carries the implementation detail. The header indicates a build level of 120.4, with the most recent change tracked to January 2013, consistent with code shipped in the 12.1.1 and 12.2.2 codelines.

Key Procedures and Functions

  • COPY_TC — The primary copy procedure. It duplicates terms content from a specified source document type and identifier into a target document, returning the generated target document type and identifier through IN OUT parameters. It supports numerous behavior flags, including retaining versions, retaining deliverables, allowing duplicates, copying abstracts, copying for amendment, retaining clauses, and retaining locks on terms and exported content. It also accepts a target template record, an article effective date, a document number, and contract administrator and legal contact identifiers.
  • COPY_ARCHIVED_DOC — Dedicated to copying an archived document. This is the procedure associated with the user search term copy_archived_doc. It takes a source document type, source document identifier, and an explicit source version number, together with a target document type and target document identifier, an optional document number, and an allow-duplicates flag. It returns the standard API return status, message data, and message count. Its inclusion of a version number parameter distinguishes it from COPY_TC, which operates against the current source content.
  • GET_VARIABLE_VALUE_ID — Returns the identifier of a variable value for a given category and variable code.
  • GET_VARIABLE_VALUE — Retrieves the value associated with a terms variable.
  • GET_ORIG_VAR_VAL — Resolves the original (pre-substitution) value of a variable, typically used when reproducing source text or default values.
  • GET_ORIG_VAR_VAL_XML — Returns the original variable value in XML form, supporting structured or markup-based terms content.

Tables Accessed

The package reads and writes the core terms storage model through APPS synonyms. Article content is held in OKC_ARTICLES_ALL, OKC_ARTICLE_VERSIONS, and OKC_ARTICLE_ADOPTIONS, while variable definitions and bindings reside in OKC_ARTICLE_VARIABLES, OKC_K_ART_VARIABLES, OKC_K_ART_VARIABLES_H, and OKC_K_ART_VAR_EXT_B. Clause instances are managed through OKC_K_ARTICLES_B plus its history and security companions OKC_K_ARTICLES_BH and OKC_K_ARTICLES_B_S. Configuration and setup data come from CZ_CONFIG_HDRS, OKC_BUS_DOC_TYPES_B, OKC_BUS_VARIABLES_B, OKC_ALLOWED_TMPL_USAGES, and OKC_ALLOWED_TMPL_USAGES_S. Together these tables allow the copy routines to recreate article structures, preserve variable context, and enforce allowed template usage rules.

Usage Notes

OKC_TERMS_COPY_PVT is normally called indirectly. Oracle Contracts forms that support clause and template copying, amendment workflows, and version creation delegate to it, as do other OKC packages — the metadata records three referencing packages. Custom code should prefer the corresponding public APIs, invoking this package only with the documented parameters and always honoring the p_api_version, p_init_msg_list, and p_commit conventions. Callers must check x_return_status and retrieve messages via x_msg_count and x_msg_data. The copy_archived_doc entry point is appropriate when reproducing a historical version of a document rather than current content.