Search Results validate_rgd_code




Overview

OKC_RGR_PVT is a private PL/SQL package body in the Oracle E-Business Suite Contracts (OKC) module. It supports the Rules and Rule Groups framework that governs how contract terms, clauses, and validation rules are applied during contract authoring and processing. The package encapsulates the low-level database operations for the OKC_RG_DEF_RULES entity — a table that stores the definition of rules required for a contract rule group. Because it is classified as a private API (PVT), it is intended for internal use by the Contracts application and by other OKC packages rather than for direct customer invocation.

The object is chiefly invoked through the public layer and by two referencing packages. The user search term "validate_rgd_code" corresponds to the validate_row family of logic in this package, specifically the RGD_CODE (rule definition code) validation performed against OKC_RG_DEF_RULES.

Key Procedures and Functions

  • QC — Standard quality-control entry point used to register or verify the package within the OKC infrastructure.
  • CHANGE_VERSION — Manages concurrency/versioning for the rule definition rows so that updates are applied against the correct record version.
  • API_COPY — Copies rule definition records, typically used when copying a rule group or contracting template.
  • INSERT_ROW — Inserts new OKC_RG_DEF_RULES rows, first invoking the validation logic described below.
  • LOCK_ROW — Places a row lock prior to update to prevent concurrent modification.
  • UPDATE_ROW — Updates the mutable attributes of an existing rule definition.
  • DELETE_ROW — Logical or physical removal of a rule definition record.
  • VALIDATE_ROW — The central validation routine. Its private helper validate_uniqueness queries OKC_RG_DEF_RULES for a matching RGD_CODE / RDF_CODE combination, ensuring a rule-definition-code is not duplicated within the same rule. The private function validate_attributes and the constants G_NO_PARENT_RECORD, G_UNEXPECTED_ERROR, and G_SQLERRM_TOKEN support error handling and messaging.

Tables Accessed

  • OKC_RG_DEF_RULES — The primary table. It stores rule definitions with the composite key RGD_CODE (rule definition code) and RDF_CODE. All insert, update, delete, and uniqueness validation operate on this table.
  • FND_LOOKUP_VALUES — Used to validate enumerations and translated lookup codes referenced during attribute validation.
  • OKC_RULE_DEFS_B — The base table holding rule definition headers; referenced for parent record existence checks (hence the G_NO_PARENT_RECORD error constant).
  • PLITBLM — A generic PL/SQL index table used for internal collection handling.

Usage Notes

OKC_RGR_PVT is invoked primarily by the public OKC API layer and by the two packages that reference it. It is not intended for direct custom invocation; customers integrating with Contract Terms should call the public OKC APIs, which delegate to this private body. Because the private validate_uniqueness routine performs a direct cursor check on RGD_CODE / RDF_CODE and replaced an earlier OKC_UTIL.check_comp_unique call for performance reasons, duplicate rule definition codes are rejected before the row reaches the base table. This package operates under the ETRM 12.1.1 / 12.2.2 code line and is also invoked from the OKC_RG_DEF_RULES_V view context (G_VIEW) during validation of rule definition records.