Search Results run_lead_engines




Overview

AS_SALES_LEAD_ENGINE_PVT is a private PL/SQL package in the Oracle EBS Applications (APPS) schema that implements the core processing logic for Sales Lead Engines within the Oracle Sales (AS) product family. The package is declared with AUTHID CURRENT_USER, meaning its SQL statements execute with the privileges of the calling user rather than the definer, which is consistent with Oracle's standard API architecture for ensuring that row-level security and MOAC (Multi-Org Access Control) policies are honored at runtime. The package header records a creation date of 02/04/2002 and an AS/PV naming convention in which the AS schema provides the package specification and the PV layer provides the implementation body. A revision dated 01/16/2003 removed the START_PARTNER_MATCHING procedure, relocating that functionality to PV_BG_PARTNER_MATCHING_PUB — an important historical note for environments that may still reference the older entry point. In the context of the user's search term "run_lead_engines," this package is the definitive implementation object behind the lead engine invocation.

The package's stated purpose is "Sales Leads Engines" — it encapsulates the scoring, ranking, rating, and selection logic applied to sales leads, together with the post-create and post-update processing hooks that drive downstream lead lifecycle behavior.

Key Procedures and Functions

The ETRM metadata documents four procedures for this package. Parameter lists are intentionally not reproduced here; the descriptions reflect documented purpose only.

  • RUN_LEAD_ENGINES — the primary entry point matching the user's search term. It executes the configured lead engines against a specified sales lead, returning a lead engines output record along with the standard API return status, message count, and message data. It accepts a sales lead identifier plus optional administrative group, identity salesforce, and sales group identifiers for filtering and security scoping.
  • RATE_SELECT_LEAD — applies rating and selection logic to a given lead, accepting a process type to distinguish the rating or selection context. It returns an action value together with the standard API status outputs.
  • LEAD_PROCESS_AFTER_CREATE — a post-creation hook invoked after a sales lead has been inserted, allowing engine processing such as scoring, rank derivation, and denormalized hierarchy updates to occur as part of the create transaction.
  • LEAD_PROCESS_AFTER_UPDATE — the corresponding post-update hook, triggered after modification of an existing lead so that engine results remain consistent with the changed lead data.

All four procedures follow the Oracle API convention of accepting an API version number, an initialization flag for the message list, a commit flag, a validation level, and returning X_RETURN_STATUS, X_MSG_COUNT, and X_MSG_DATA. Note that the 11.5.10 "Phase 2 filtering project" comments indicate that the P_Is_Create_Mode parameter was deprecated in favor of the filtering parameters.

Tables Accessed

The package operates across a broad set of documented APPS synonyms. Core lead tables include AS_SALES_LEADS, AS_SALES_LEAD_LINES, AS_SALES_LEADS_LOG, and AS_SALES_LEAD_RANKS_B, which store the lead header, lead line detail, audit log, and rank definitions that the engines read and update. AS_CHANGED_ACCOUNTS_ALL and AS_STATUSES_B support change tracking and status validation. Party model tables — HZ_PARTIES, HZ_PARTY_SITES, HZ_LOCATIONS, and HZ_CONTACT_POINTS — supply customer and contact context used when evaluating or matching leads. ENI_DENORM_HRCHY_PARENTS provides the denormalized hierarchy parent relationships referenced during classification and rollup. Resource and channel metadata are drawn from JTF_RS_RESOURCE_EXTNS, PV_CHANNEL_TYPES, and PV_ATTRIBUTES_B, while PV_ENTITY_RULES_APPLIED supplies the rule application records that govern engine behavior.

Usage Notes

As a PVT (private) API, AS_SALES_LEAD_ENGINE_PVT is not intended for direct invocation by external integrations. It is instead called by the public AS_SALES_LEADS_PUB package and by the five other packages documented as referencing it in ETRM. Typical invocation paths include the Sales Leads forms in the Oracle Sales application — particularly lead creation and update flows, where LEAD_PROCESS_AFTER_CREATE and LEAD_PROCESS_AFTER_UPDATE are triggered automatically — and any concurrent program or batch process that scores or ranks leads in bulk. The presence of explicit commit and validation-level parameters allows callers to participate in a larger transaction, deferring commit until the enclosing process completes. Customizations should target the public AS_SALES_LEADS_PUB interface rather than this private package, since signatures may change between releases; the deprecation of P_Is_Create_Mode and the removal of START_PARTNER_MATCHING illustrate that risk. The package is documented in ETRM for both Oracle EBS 12.1.1 and 12.2.2.