Search Results process_workorder




Overview

APPS.AHL_PRD_WO_PUB is a public PL/SQL package body belonging to the Oracle Enterprise Asset Management (EAM) and Complex Maintenance, Repair and Overhaul (CMRO) product family, identified by the AHL application prefix. In Oracle EBS 12.1.1 and 12.2.2 it serves as the primary programmatic interface for retrieving and processing work order data associated with production, maintenance, and visit-based activities. The package exposes a published API surface intended for consumption by Oracle Forms, concurrent programs, Business Process Execution Language (BPEL) workflows, and custom extensions. Its documented procedures support the extraction of complete work order detail — header information, operations, material requirements, resource transactions, associated documents, turnover notes, and quality assurance plan results — as well as the submission of work orders through PROCESS_WORKORDER. A notable utility, INIT_USER_AND_ROLE, establishes an APPS session context for a nominated user, resolving both the FND_USER identifier and a BPEL responsibility derived from the AHL_BPEL_USER_ROLE profile option before invoking FND_GLOBAL.APPS_INITIALIZE and MO_GLOBAL.INIT('AHL'). The package is referenced by three other packages, confirming its role as a shared integration layer rather than an isolated utility.

Key Procedures and Functions

  • GET_WORKORDER_DETAILS — Returns the principal attributes of a single work order, forming the base cursor for downstream consumers.
  • GET_WO_OPERATIONS_DETAILS — Retrieves the operation routing lines belonging to a work order.
  • GET_WO_MTL_REQMTS — Returns material requirements associated with the work order.
  • GET_WO_ASSOC_DOCUMENTS — Lists documents linked to the work order through the attachments framework.
  • GET_WO_TURNOVER_NOTES — Supplies shift turnover or handover notes recorded against the work order.
  • GET_WO_RES_TXNS — Returns resource transactions charged to the work order.
  • GET_QA_PLAN_RESULTS — Retrieves quality assurance plan results collected during execution.
  • PROCESS_WORKORDER — Performs the primary processing action on a work order, applying validation and message handling consistent with the FND_API standard.
  • GET_MSG_DATA — Returns the accumulated message stack generated by the preceding API call. This is the object the user searched for; it provides callers with formatted message data after a PL/SQL API invocation, enabling the calling form, BPEL process, or custom program to surface errors and warnings raised via FND_MSG_PUB.
  • INIT_USER_AND_ROLE — Initialises the APPS runtime context for a supplied user name, resolving the user and responsibility identifiers and raising AHL_PRD_INV_BPEL_USR through FND_MESSAGE when the user cannot be found.

Private helper functions supporting these APIs include GET_WORKORDER_ID, GET_WORKORDER_OPERATION_ID, GET_QA_SQL_STR, EXTRACT_SERIAL_NUMBER, and IS_VALID_RESULT_ATTRIBUTE.

Tables Accessed

Usage Notes

The package is typically invoked from CMRO/EAM work order forms, from BPEL-based integration flows that drive work order processing asynchronously, and from custom PL/SQL that requires standardised work order extraction. Callers must first establish an APPS session, either through the standard FND_GLOBAL.APPS_INITIALIZE sequence or via INIT_USER_AND_ROLE when acting on behalf of a BPEL service user. After any API call, GET_MSG_DATA should be invoked to retrieve the message stack raised through FND_MSG_PUB, particularly because PROCESS_WORKORDER follows the FND_API convention of populating the global message list rather than returning error text directly.