Search Results g_k_approval




Overview

OKL_CONTRACT_STATUS_PVT is a private PL/SQL package in the Oracle Lease and Finance Management (OKL) module of Oracle E-Business Suite, present in releases 12.1.1 and 12.2.2. It declares AUTHID CURRENT_USER, meaning its SQL executes with the privileges of the invoking session rather than the package owner. As a PVT (private) API — the counterpart to the public OKL_CONTRACT_STATUS_PUB package — it encapsulates the internal logic that governs the lifecycle status of lease and finance contracts. The package determines whether a given contract action or status transition is permitted, applies status changes to the underlying contract records, and propagates (cascades) a parent contract's status to related leases and contract lines. It is not intended for direct customer invocation but serves the public API layer, forms, and concurrent processes that manage contract state.

Key Procedures and Functions

The package exposes four documented procedures. Each follows the standard EBS API signature convention in which p_api_version and p_init_msg_list are input parameters and x_return_status, x_msg_count, and x_msg_data return execution outcome and message-buffer information.

  • GET_CONTRACT_STATUS — Determines whether the action specified by p_event is permissible for the contract identified by p_chr_id. It returns x_isAllowed to signal the validity of the action and populates x_PassStatus and x_FailStatus with the resulting statuses for the success and failure branches of the transition. The event codes are defined as package constants (for example G_K_NEW, G_K_EDIT, G_K_QACHECK, G_K_STRMGEN, G_K_JOURNAL, G_K_SUBMIT4APPRVL, G_K_APPROVAL, and G_K_ACTIVATE).
  • UPDATE_CONTRACT_STATUS — Applies a status value supplied in p_khr_status to the contract identified by p_chr_id. This is the mechanism by which an approved transition is persisted to the contract header.
  • CASCADE_LEASE_STATUS — Cascades the status of a parent contract down to associated leases and dependent records, keyed by p_chr_id. This keeps child lease records synchronized when a master contract changes state.
  • CASCADE_LEASE_STATUS_EDIT — Performs the equivalent cascade behavior in the context of an edit operation, propagating status changes to dependent lease records during contract modification.

Tables Accessed

Through APPS synonyms the package operates on the core Lease Management contract tables:

  • OKC_K_HEADERS_B and OKC_K_LINES_B — the contract header and line base tables, read to evaluate the current contract state and written when status changes are applied.
  • OKC_STATUSES_B — the status definition table used to validate status codes and resolve transition rules.
  • OKL_K_HEADERS and OKL_TRX_CONTRACTS — the OKL lease header and transaction contract tables, the primary targets of the status cascade logic.
  • DUAL — used for single-row evaluations and dummy queries.
  • PLITBLM — the standard PL/SQL message table used by the API message-buffer mechanism to store and retrieve error and informational messages.

Usage Notes

Because this is a private package, it is not called directly by end users or typical customizations. It is invoked indirectly whenever contract status must be checked, changed, or propagated — most commonly from Lease Management contract forms, from the public OKL_CONTRACT_STATUS_PUB wrapper, and from concurrent programs or workflow processes handling activation and approval. The metadata records that two other packages reference it, confirming its role as an internal dependency of the OKL contract-status API stack. Custom code requiring status validation or cascade behavior should call the public API rather than this private package directly, to preserve supportability across EBS 12.1.1 and 12.2.2.