Search Results rule_tbl_type




Overview

OKC_XPRT_RULE_PVT is a private (PVT) PL/SQL package in the Oracle E-Business Suite Contracts (OKC) module, specifically supporting the Expert Rules (XPRT) engine used by Oracle Contract Terms Library. In the 12.1.1 and 12.2.2 releases, this package encapsulates the business logic for creating, maintaining, and removing the rule definitions that drive clause and template selection during contract authoring. Expert rules allow an organization to encode conditional logic — such as jurisdiction, contract type, or user-entered answers — that determines which terms templates, articles, and clauses are presented to a user.

The package is declared with AUTHID CURRENT_USER, meaning it executes with the privileges of the calling schema. It inherits the standard EBS API conventions from FND_API and OKC_API, including the success/error return status constants (G_RET_STS_SUCCESS, G_RET_STS_ERROR, G_RET_STS_UNEXP_ERROR) and the OKC_API.G_MISS_NUM, G_MISS_CHAR, and G_MISS_DATE sentinel values. Note that the user search term rule_tbl_type corresponds to the template_rules_rec_type record type defined at line 29 of the specification, which models a row of the OKC_XPRT_TEMPLATE_RULES table and is the record structure passed through the private API surface. Based on the header comment ($Header: OKCVXIRS.pls 120.2), the package has remained comparatively stable across the 12.1.1 to 12.2.2 upgrade path.

Key Procedures and Functions

The ETRM metadata documents three procedures in this package:

  • CREATE_RULE — Inserts a new expert rule definition and its associated conditions, condition values, and outcomes. It is the primary entry point for defining the logic that governs template and clause selection.
  • UPDATE_RULE — Modifies an existing rule, including its header attributes, conditions, and outcomes, while preserving the record's object version number for optimistic locking.
  • DELETE_RULE_CHILD_ENTITIES — Removes the dependent child records (conditions, condition values, and outcomes) associated with a rule, typically invoked as part of rule deletion or replacement. Given its name, it is a helper procedure that isolates the cascading delete of child rows rather than the rule header itself.

All three procedures follow the standard EBS private-API contract, returning a status and, where applicable, an error message, consistent with the G_RET_STS_* constants defined in the specification.

Tables Accessed

The package operates across the Expert Rules data model. The rule header is maintained in OKC_XPRT_RULE_HDRS_ALL, with the many-to-many template linkage in OKC_XPRT_TEMPLATE_RULES. Child rows are stored in OKC_XPRT_RULE_CONDITIONS and OKC_XPRT_RULE_CONDITION_S (the intersection and its security counterpart), with condition values in OKC_XPRT_RULE_COND_VALS and OKC_XPRT_RULE_COND_VALS_S, and rule results in OKC_XPRT_RULE_OUTCOMES.

The package also reads supporting reference data: OKC_XPRT_QUESTIONS_B (rule questions), OKC_TERMS_TEMPLATES_ALL and OKC_ARTICLES_ALL/OKC_ARTICLE_VERSIONS/OKC_ARTICLE_ADOPTIONS (the terms artifacts the rules target), FND_LOOKUP_VALUES and FND_FLEX_VALUE_SETS (validation and lookup data), and HR_ORGANIZATION_INFORMATION (organizational context). The _S tables imply the package respects the EBS security model for rule visibility.

Usage Notes

As a PVT package, OKC_XPRT_RULE_PVT is not a public API and is not intended for direct invocation by external or custom code. It is called internally by the Expert Rules engine and by the public wrapper packages that expose rule administration to the Contract Terms Library setup UI (the Expert Rules and Template Rules windows in Forms) and to concurrent programs that validate or publish rules. The metadata indicates it is referenced by one other package, confirming its position as an internal collaborator rather than an entry point.

Because the procedures rely on OKC_API.G_MISS_* sentinels and object version numbers, callers must populate the template_rules_rec_type style records fully and correctly. Customizations should target documented public APIs or the underlying tables rather than this package, since Oracle supports private packages only internally and may change their signatures between patch levels. Any direct dependency risks breakage on upgrade from 12.1.1 to 12.2.2.