Search Results x_org_id




Overview

APPS.CN_GET_EXPRESSION is a PL/SQL package body within the Oracle EBS Incentive Compensation (CN) module. Its purpose is to construct, store, and manage the textual expressions that represent rule logic evaluated by the Incentive Compensation engine. These expressions are built from the operands, operators, and descriptive rule attributes stored in the compensation rule attribute tables, and are later used during rule processing or code generation routines. The package body shown in the ETRM documentation is version-controlled as cngtexpb.pls 120.1, dated 2005/07/18, indicating it is an older, stable component that predates the 12.1.1 and 12.2.2 releases and has been carried forward largely unchanged.

Key Procedures and Functions

The documented metadata lists two procedures for this package: MAIN and DELETEEXPRESSION.

  • MAIN — Serves as the primary entry point for driving expression construction. It orchestrates the logic required to read rule attribute expression rows and assemble the corresponding expression text. The primary worker routine embedded in the source, build_table, accepts a rule identifier, a usage indicator, and an organization identifier (the x_org_id parameter that the user searched for) and iterates over the CN_RULE_ATTR_EXPRESSION rows to build left and right operand expressions. Operands flagged as a rule attribute ("RA") are resolved into descriptive expressions, while operands flagged as a rule attribute expression ("RAE") are drawn from the package's cache of intermediate expressions.
  • DELETEEXPRESSION — Removes previously generated expression data, typically invoked when a rule is modified or deleted so that stale expressions are not retained and reused incorrectly.

The body also maintains the global variable g_intermediate_expr, which acts as a counter or identifier generator for sub-expressions encountered during a build pass, and a global collection g_rae used to cache intermediate expression text.

Tables Accessed

The package reads and writes the following documented tables through APPS synonyms:

  • CN_RULE_ATTR_EXPRESSION — The core driver table. The cursor get_rae selects operand1, operand1_ra_rae_flag, operand2, operand2_ra_rae_flag, and operator for a given rule and organization. This is where the rule's conditional structure is defined.
  • CN_ATTRIBUTE_RULES — Provides the descriptive rule attribute text used to resolve "RA" operands into human-readable expression fragments.
  • PLITBLM — A standard Oracle Forms/PL/SQL utility table, typically used for debugging or indexed temporary storage during expression build operations.

Usage Notes

This package is invoked whenever the Incentive Compensation rule engine needs to materialize or refresh the expression text associated with a compensation rule. The x_org_id parameter indicates that all operations are organization-scoped, consistent with the multi-org architecture of the CN module. Typical invocation sources include the Incentive Compensation rule administration forms and concurrent programs that compile or validate rule definitions prior to transaction processing. The x_usage parameter, set to values such as 'Code Generation', allows callers to control output formatting — for example, translating numeric operator codes into textual operators like 'OR' for generated code. Because the package body is not referenced by any other documented packages, its consumers are expected to be external callers such as forms, concurrent programs, or custom extensions rather than dependent PL/SQL units. Customers extending compensation rule logic should avoid modifying this package directly and instead rely on supported APIs, as internal cursor logic and expression formatting are tightly coupled to the CN rule engine.