Search Results calculate_use_count




Overview

The APPS.AME_RULE_USAGES_API package body is part of the Oracle Approvals Management (AME) infrastructure in Oracle E-Business Suite 12.1.1 and 12.2.2. AME provides the rule-based engine that determines approval routing, approver lists, and authorization limits for transactions across the EBS application suite, including iProcurement requisitions, Purchasing documents, and Human Resources transactions. The AME_RULE_USAGES_API package manages the association between approval rules and the calling application contexts—referred to as "items"—in which those rules are applicable. Its principal role is to maintain the AME_RULE_USAGES intersection records that express which rules are used by which item, and to compute the usage counts that other AME components rely upon when validating, evaluating, or deleting rules.

The package is classified as an API in the ETRM repository, indicating that it is intended to be invoked programmatically rather than through direct table manipulation. It is owned by APPS and does not appear in the list of packages that are referenced by other documented packages, which suggests it functions as a leaf-level utility within the AME rule maintenance stack.

Key Procedures and Functions

The ETRM metadata documents three procedures and functions for this package: INSERT_ROW, DELETE_ROW, and LOAD_ROW.

  • INSERT_ROW — Creates a new rule usage record, establishing the association between a specified rule and the item (calling application context) in which the rule participates. It is the standard entry point for adding a rule-to-item linkage.
  • DELETE_ROW — Removes an existing rule usage record, typically invoked when a rule is being detached from a calling application or removed entirely from the AME configuration.
  • LOAD_ROW — Performs an idempotent insert-or-update operation, ensuring a rule usage row exists with the desired attribute values. This supports seeding, migration, and bulk maintenance of AME rule usage data.

The package body source additionally contains internal helper logic, including a KEY_TO_IDS procedure that resolves an application short name and transaction type to an internal ITEM_ID and then counts matching rows in AME_RULE_USAGES, and a CALCULATE_USE_COUNT function that computes the number of usages for a given attribute. These private constructs support the public API surface .

Tables Accessed

The package operates over a broad set of AME configuration tables, referenced through APPS synonyms:

Usage Notes

This API is normally invoked indirectly. The AME Rule Maintenance and Approvals Management configuration UIs (for example, the AME Business Rules and rule setup forms) call the rule usage APIs when an administrator creates, modifies, or deletes rule-item associations. Concurrent programs that seed or migrate AME configurations—particularly those using LOAD_ROW—also drive this package. Custom code should treat it as an API and avoid direct DML against AME_RULE_USAGES, since the package maintains the usage counts and referential consistency that AME's rule evaluation engine depends upon. In 12.2.2 the object remains an APPS-owned API with no downstream dependents in the documented repository, confirming it as a supporting maintenance utility rather than a shared integration point.