Search Results dequeue_event




Overview

OKC_AQ_PVT is a private (PVT) PL/SQL package in the APPS schema that provides the Advanced Queuing (AQ) messaging layer for the Oracle Contract Lifecycle Management (OKC) module. Its principal business function is to broker asynchronous events and outcomes between the contract authoring engine and external or internal subscribers. Rather than having callers manipulate DBMS_AQ enqueue and dequeue primitives directly, OKC_AQ_PVT wraps queue access in a controlled API, supplying standard EBS API conventions such as p_api_version, p_init_msg_list, p_commit, and the x_return_status/x_msg_count/x_msg_data OUT parameters. The package header source dates to 2005 and is marked noship, indicating it is a runtime-only component. It is declared AUTHID CURRENT_USER, so it executes with the privileges of the invoking session.

Key Procedures and Functions

The package exposes eleven documented program units:

  • GET_ACN_TYPE — a function returning the action (ACN) type associated with a supplied correlation identifier, used to route or classify an incoming message.
  • SEND_MESSAGE — an overloaded procedure supporting both VARCHAR2 and CLOB message payloads. It enqueues a message to the event queue using the constants g_event_queue_name, g_msg_expire, and the correlation record.
  • LISTEN_EVENT — registers a listener on the event queue, initiating asynchronous consumption of contract action events.
  • LISTEN_OUTCOME — registers a listener on the outcome queue, the counterpart to LISTEN_EVENT for result messages.
  • DEQUEUE_EVENT — dequeues a message from the event queue, honoring the g_dequeue_wait timeout constant; this is the routine users search for under the term "dequeue_event".
  • DEQUEUE_DATE_EVENT — a variant of DEQUEUE_EVENT that applies date-based selection or filtering criteria to the dequeued event.
  • DEQUEUE_OUTCOME — dequeues a message from the outcome queue.
  • DEQUEUE_EXCEPTION — dequeues an exception or error message, providing the error-handling path for the listener loop.
  • REMOVE_MESSAGE — removes a specific message from the queue.
  • CLEAR_MESSAGE — clears pending messages, typically used to reset queue state.
  • STOP_LISTENER — terminates an active listener previously started by LISTEN_EVENT or LISTEN_OUTCOME.

Tables Accessed

Queue persistence is provided by the AQ infrastructure tables OKC_AQ_EV_TAB and its queue-table companions AQ$OKC_AQ_EV_TAB, AQ$OKC_AQ_EV_TAB_S, AQ$_OKC_AQ_EV_TAB_H, and AQ$_OKC_AQ_EV_TAB_S, manipulated through DBMS_AQ and DBMS_AQADM. Contract action data is read from OKC_ACTIONS_B (the correlation identifier source), OKC_ACTION_ATT_VALS (attribute values for message payloads), and OKC_CONDITION_HEADERS_B (contract terms context). Configuration values, including queue names, are derived from FND_PROFILE_OPTIONS and FND_PROFILE_OPTION_VALUES. Large payload handling uses DBMS_LOB, and PLITBLM is referenced for PL/SQL table utilities. Types msg_rec_typ, msg_tab_typ, and corrid_rec_typ are declared in the package header to structure message elements and correlation data.

Usage Notes

OKC_AQ_PVT is an internal implementation package and is referenced by 27 other packages in the OKC module; direct invocation from custom code is generally discouraged in favor of the public OKC APIs. Typical callers are contract authoring workflows that must publish or consume asynchronous events, listener processes that poll the event and outcome queues using the DEQUEUE_* routines, and error-recovery logic that consumes exception messages. The package may also be exercised indirectly through concurrent programs that monitor or clear the OKC queue. Because it is AUTHID CURRENT_USER and relies on APPS synonyms to FND and AQ objects, execute privileges should be granted judiciously.