Search Results evaluate_condition




Overview

The APPS.OKC_CONDITION_EVAL_PUB package body is the public evaluation layer of the Oracle E-Business Suite Contracts (OKC) condition engine. Its business purpose is to determine whether the conditions attached to a contract or contract plan are satisfied, and to return the resulting outcomes for use by downstream contract lifecycle processes. Within Oracle EBS 12.1.1 and 12.2.2, the package acts as a thin public wrapper around the private evaluation logic held in OKC_CONDITION_EVAL_PVT, exposing a controlled, API-standard surface for callers such as contract authoring forms, pricing and pricing adjustment routines, and custom extensions. The package follows the standard ETRM public API idiom, including activity start/end handling and the OKC_API message stack, ensuring consistent error reporting and savepoint semantics.

Key Procedures and Functions

The documented public interface exposes four routines:

  • EVALUATE_PLAN_CONDITION — The principal public entry point. It evaluates the conditions attached to a plan, delegates the work to OKC_CONDITION_EVAL_PVT.evaluate_plan_condition, and returns a synchronous outcome table (an outcome_tab_type) describing each condition that evaluated to TRUE. The excerpt confirms it accepts an API version, message initialization flag, standard x_return_status, x_msg_count and x_msg_data outputs, a condition header identifier (p_cnh_id), and an inbound message table (p_msg_tab).
  • EVALUATE_CONDITION — The internal API name constant (l_api_name) and the procedure identifier logged during execution; it represents condition evaluation at the individual condition level rather than at the plan level.
  • EVALUATE_DATE_CONDITION — A specialised routine that evaluates conditions whose outcome depends on date comparison logic, such as effective or expiry date checks against the current date or a supplied reference date.

Tables Accessed

Two base tables are documented as referenced through APPS synonyms:

  • OKC_CONDITION_HEADERS_B — The condition header table. The package reads condition header definitions, including the ID passed as p_cnh_id, to establish which conditions require evaluation and how they are configured.
  • OKC_ACTIONS_B — The actions table. It supplies the actions associated with satisfied conditions, supporting the construction of the outcome table returned by EVALUATE_PLAN_CONDITION.

The package accesses these objects only indirectly, delegating the SQL and cursor work to the private package; the public body itself contains minimal data manipulation.

Usage Notes

OKC_CONDITION_EVAL_PUB is normally invoked from contract-related forms and from pricing or contract generation routines that need to confirm condition eligibility before applying a term, discount, or action. Because it is classified as a PUB API, it is also the supported surface for custom code and extensions in both 12.1.1 and 12.2.2. Callers should pass FND_API.G_TRUE for p_init_msg_list to guarantee a clean message stack, and must inspect x_return_status for G_RET_STS_SUCCESS, G_RET_STS_ERROR, or G_RET_STS_UNEXP_ERROR. The package is referenced by three other packages within the condition evaluation subsystem, indicating it functions as a shared dependency rather than an end-user entry point. Debug output is produced only when the AFLOG_ENABLED profile option is set to Y.