Search Results g_unexpected_error




Overview

OKL_GENERATE_STREAMS_PVT is a private (PVT) PL/SQL package body in the Oracle E-Business Suite Lease and Finance Management (OKL/ETRM) module, owned by the APPS schema. Its principal business function is to generate lease accounting and billing streams for a lease contract by processing records staged in the stream interface table and driving them through the pricing engine. In releases 12.1.1 and 12.2.2 this package forms part of the stream generation framework that translates contract-level lease terms into the periodic cash flow streams used for revenue recognition, invoicing, and accounting.

The package includes Workflow business event integration. A header constant, G_WF_EVT_KHR_GEN_STRMS, defines the event name oracle.apps.okl.la.lease_contract.stream_generation_requested, which the package raises upon completion of stream generation so that downstream subscription processing can proceed. The header also carries a change history reference (bug 3909261) indicating the business event logic was added to signal stream generation requests reliably.

Key Procedures and Functions

  • GENERATE_STREAMS — The primary entry point. It accepts a contract identifier (p_khr_id) and a generation context code, and returns a transaction number, transaction status, plus the standard API return status, message count, and message data. Internally it invokes stream population and pricing engine logic, and it contains a nested routine, raise_business_event, that resolves the contract process through Okl_Lla_Util_Pvt and raises the stream generation Workflow event with the contract ID and process as parameters.
  • POPULATE_HEADER_DATA — Populates header-level stream data required before pricing and stream creation are attempted, ensuring the interface records carry the contract context needed for downstream processing.
  • INVOKE_PRICING_ENGINE — Calls the pricing engine to calculate and apply pricing to the generated stream records, producing the amounts used in the resulting lease streams.

Tables Accessed

The package works primarily with OKL_STREAM_INTERFACES, the staging table where generated stream records are held before validation and transfer into the permanent stream structures. It also uses WF_PARAMETER_LIST_T, the Oracle Workflow parameter list type, to assemble the arguments passed to the business event raised during generation. The contract process value supplied to that event is obtained via Okl_Lla_Util_Pvt rather than read directly here.

Usage Notes

As a PVT-classified package, OKL_GENERATE_STREAMS_PVT is not intended for direct customer invocation; it is called by public OKL APIs, concurrent stream generation programs, and the Lease Management forms when a user requests stream generation for a contract. The user search term g_unexpected_error is a generic global error constant commonly surfaced by OKL APIs when an unhandled exception occurs; when it appears in a stream generation context, it typically indicates a failure inside GENERATE_STREAMS, such as a pricing engine error or an invalid interface record.

Diagnostic steps include enabling OKL debug logging, reviewing the OKL_STREAM_INTERFACES rows for the affected contract, and inspecting the Workflow event subscriptions for the stream generation requested event. Because the package raises the event on success, absence of the event corroborates a failure in the generation or pricing step. The package is referenced by one other package in the ETRM schema, confirming its role as an internal utility rather than a standalone entry point.