Search Results get_winners_parallel




Overview

AS_GAR is the shared utility package for the Oracle EBS Service (AS) "Generation and Assignment Rule" processing framework, part of the Territory Manager / Sales and Service assignments architecture. The header comments state the package's purpose unambiguously: it "contains all the common procedures and functions called from within the individual entity packages." In the assignment engine, each entity (for example opportunities, leads, and their associated territories) has its own entity package, and every one of those packages delegates common infrastructure work to AS_GAR. That infrastructure includes initialization and session context setup, subscription and business-event handling, error logging, tracing and diagnostics, and dynamic sizing of processing work areas.

The package is owned by APPS and is classified as a general OTHER API, not a business-interface callable API. It is referenced by eleven other packages, and it serves as the common denominator for the assignment rule subprograms shipped with the AS product family. Because it is a support package rather than a user-facing API, it is normally reached indirectly.

Key Procedures and Functions

  • INIT — Initializes the package state for a processing run. It establishes the global execution context used by the other routines, populating the fields of the TERR_GLOBALS record such as user_id, last_update_login, concurrent program identifiers, run mode, worker id, bulk size, and cursor limit. It is the required first call in any generation or assignment run.
  • EXIST_SUBSCRIPTION — Determines whether a subscription to the relevant business event already exists in the workflow subscription tables. This guards against duplicate event subscriptions when a generation rule is processed repeatedly.
  • RAISE_BE — Raises the business event associated with assignment processing. It builds and emits the event through Oracle Workflow so that downstream subscribers are notified when a generation and assignment action completes or requires propagation.
  • LOG_EXCEPTION — Records an exception condition raised during entity package processing so that the failure is captured and can be reported back against the concurrent request.
  • LOG — General-purpose logging routine used by the entity packages and by AS_GAR's own routines to write diagnostic and progress messages, controlled by the G_DEBUG_FLAG package variable.
  • SETTRACE — Enables or disables trace output for the package, allowing support and development staff to capture detailed processing information without code changes.
  • SET_AREA_SIZES — Calculates and sets the sizes of internal work areas (bulk and cursor limits) used during entity processing, tuning how many records are fetched and held at one time based on the run configuration and system parameters.

Tables Accessed

AS_GAR reads and writes the workflow event infrastructure: WF_EVENTS, WF_EVENT_SUBSCRIPTIONS, WF_PARAMETER_LIST_T, and AS_BUSINESS_EVENT_S. These support the subscription check and event raise logic in EXIST_SUBSCRIPTION and RAISE_BE, and carry the parameter lists passed with the raised event. FND_CONCURRENT_REQUESTS and FND_CONCURRENT_REQUESTS_S are consulted to resolve the concurrent program, request, and phase context for the current run. V$PARAMETER and DUAL are used for environment inspection and simple expression evaluation, while PLITBLM is used for PL/SQL-internal table handling. The tables are accessed through APPS synonyms.

Usage Notes

AS_GAR is invoked indirectly. Users trigger assignment processing through concurrent programs and Oracle Forms in the Service and Territory Manager modules; the entity packages then call AS_GAR's INIT, SET_AREA_SIZES, LOG, SETTRACE, and RAISE_BE routines as part of their normal execution flow. The target routine named in the user's search, get_winners_parallel, reflects the parallel-worker processing model that the package supports: the TERR_GLOBALS record carries worker_id, bulk_size, and cursor_limit, indicating that assignment runs can be partitioned across parallel workers, with each worker using the same shared utility routines for initialization, sizing, tracing, and logging. Custom code should never call AS_GAR directly; because it is an internal support package and is not a documented callable API, its subprogram signatures may change between releases. For diagnostics, the recommended approach is to set the trace and debug flags through the supported concurrent program options rather than invoking SETTRACE or LOG from custom PL/SQL.