Search Results extract_rules




Overview

OKL_BP_RULES is an Oracle E-Business Suite PL/SQL package body owned by the APPS schema and classified under the "OTHER" API category. It belongs to the Oracle Lease and Finance Management (OKL) module, which forms part of the ETRM (Enterprise Trade and Resource Management) family of applications. The package encapsulates business logic supporting the extraction of billing-related rules associated with lease and finance contracts, operating primarily within the contract rule group and contract rule framework administered by the OKL rule APIs.

The internal constant naming convention observed in the source (l_api_name CONSTANT VARCHAR2(30) := 'OKL_CONS_BILL') indicates that the package is closely tied to consolidated billing operations. Its principal responsibility is to resolve a single, unambiguous rule value record for a given contract, rule group, and rule definition combination, providing a controlled interface for downstream billing and rule-evaluation processes.

Key Procedures and Functions

Only one procedure is documented for this package body: EXTRACT_RULES.

  • EXTRACT_RULES — Retrieves the applicable rule records for a specified contract and rule group, then narrows the result to a single rule value record. The procedure accepts an API version, an initialization flag, contract identifiers (KHR and KLE), a rule group code, and a rule definition code, returning a standard API status triple (return status, message count, message data) plus an output rule value record. Internally, it first invokes OKL_RULE_APIS_PVT.GET_CONTRACT_RGS to obtain the contract rule groups, and subsequently calls OKL_RULE_APIS_PVT.GET_CONTRACT_RULES to obtain the associated contract rules. If exactly one record is returned at either stage, that record is propagated to the caller. If more than one record is found, the procedure raises OKC_API.G_EXCEPTION_UNEXPECTED_ERROR, signalling an ambiguous configuration that the caller must resolve.

The procedure is instrumented with an API version of 1 and follows standard Oracle EBS API error-handling conventions, including the NOCOPY hint on OUT parameters for performance.

Tables Accessed

The documented metadata lists a single referenced table via an APPS synonym: PLITBLM. This table is used internally by the underlying rule APIs (OKL_RULE_APIS_PVT) that OKL_BP_RULES delegates to for rule retrieval. The primary data of interest — contract rule groups and contract rules — is accessed indirectly through these private APIs rather than through direct SQL against base tables within OKL_BP_RULES itself. This design preserves encapsulation and ensures that rule-access logic remains centralized in the rule APIs layer.

Usage Notes

OKL_BP_RULES is not referenced by any other documented package, indicating it is a leaf-level utility rather than a shared library. It is most likely invoked from Oracle Forms, concurrent programs, or custom extensions within the Lease and Finance Management flow, particularly in processes related to consolidated billing ('OKL_CONS_BILL'). Typical invocation contexts include:

  • Billing generation routines that must resolve a single applicable rule per contract and rule group.
  • Custom PL/SQL code extending OKL billing behaviour, where a specific rule definition code (for example, 'LABILL') must be extracted and evaluated.
  • Diagnostic or data-migration scripts requiring rule values for a known contract and rule group.

Because the procedure raises an exception when more than one matching rule is found, callers should ensure that contract-rule configurations are uniquely defined; otherwise, they must trap OKC_API.G_EXCEPTION_UNEXPECTED_ERROR and handle the ambiguity. Standard API error handling — checking x_return_status and processing x_msg_count/x_msg_data — should be applied after every call.