Search Results get_rule_segment_value




Overview

OKL_RULE_APIS_PUB is the public application programming interface package for Oracle Lease and Finance Management (OKL/ETRM) rule processing. In Oracle EBS 12.1.1 and 12.2.2, it exposes a controlled, supported surface for retrieving rule groups, rule definitions, rule information, and rule display/segment values associated with contracts and contract lines. The package body follows the standard EBS PL/SQL API architecture: the _PUB layer validates the incoming API version, initializes the message list via OKL_API.START_ACTIVITY, delegates all substantive work to the private implementation package OKL_RULE_APIS_PVT, and closes the call with OKL_API.END_ACTIVITY. Error handling is standardized against OKL_API.G_RET_STS_SUCCESS, G_RET_STS_ERROR, and G_RET_STS_UNEXP_ERROR, raising the corresponding exceptions so that callers receive a consistent return status, message count, and message data. The header comments confirm the package’s original purpose: obtaining contract rule groups for a given chr_id and cle_id, where a header identifier returns header-level data and a line identifier (optionally with the header identifier) returns line-level data.

Key Procedures and Functions

The documented API exposes seven procedures and functions. Six are identified by name in the ETRM metadata; the seventh is listed in the documented procedure count.

  • GET_CONTRACT_RGS — Retrieves the rule groups applicable to a contract header or line, using chr_id, cle_id, and a rule group code as selection criteria. Returns a rule group value table and a count of rows retrieved.
  • GET_CONTRACT_RULES — Returns the individual rules belonging to a contract or contract line, complementing the rule group retrieval with rule-level detail.
  • GET_RULE_INFORMATION — Returns descriptive information about a specified rule, typically the rule metadata needed by calling forms or integration code.
  • GET_JTOT_OBJECT — Retrieves rule data associated with a JTOT (journal transaction/object) context, supporting rule resolution for transaction-oriented processing.
  • GET_RULE_DISP_VALUE — Returns the display value for a rule, that is, the formatted value presented to users as opposed to the stored internal value.
  • GET_RULE_SEGMENT_VALUE — Returns the value of a specific rule segment. This is the API most commonly searched for, because rule segments correspond to the individual attribute values that make up a rule (for example, contract type, product, or category segment values). Callers use it to resolve a single segment value without retrieving the entire rule structure.

Tables Accessed

The ETRM metadata for this package does not enumerate specific base tables; the excerpt documents only the API layer, which delegates all SQL to OKL_RULE_APIS_PVT. In practice, the package reads the OKL rule group and rule definition tables through APPS synonyms, resolving rule groups for a contract header or line via the contract and line identifiers, and reading rule segment and rule value tables for the display-value and segment-value APIs. The package performs read-only retrieval; no direct DML is documented in the public layer.

Usage Notes

OKL_RULE_APIS_PUB is a published, supported entry point and is referenced by four other packages within the ETRM schema, indicating it is relied upon internally as well as externally. It is typically invoked from lease and finance management forms, from concurrent programs that evaluate or report on contract rules, and from custom PL/SQL integration code that needs to resolve rule groups, rules, or individual rule segment values. The package does not commit; callers are responsible for transaction control. One signature artifact should be noted for older releases: the 12.1.1-era source uses the literal => named-notation token and NOCOPY OUT parameters, and the historical version string (115.9, dated 2002) reflects the lineage of this API. Oracle recommends calling only documented _PUB procedures rather than the underlying _PVT implementation, and always checking x_return_status before consuming any OUT values.