Search Results auto_approve_check




Overview

The APPS.WIP_EAM_WORKREQUEST_PVT package is a private PL/SQL API within Oracle Enterprise Asset Management (EAM) that encapsulates the core business logic for creating, validating, updating, and approving work requests. A work request represents a maintenance need reported by a user before it is converted into a formal work order. This package provides the programmatic infrastructure that the Work Request entry form (often referenced by developers as the "work request form" or associated with the i3c-style maintenance reporting interface) and other callers rely upon to persist facility maintenance requests against assets, asset groups, and owning departments.

The package is classified as a private (PVT) API, meaning it is intended primarily for internal consumption by EAM forms, concurrent programs, and dependent packages rather than as a formally published public interface. It carries version metadata referencing the Work Request Enhancement Project and supports both the R12.1.1 and R12.2.2 code lines. Standard Oracle API conventions apply: callers pass p_api_version and optionally p_init_msg_list, p_commit, and p_validation_level, and receive back the standard x_return_status, x_msg_count, and x_msg_data output parameters for error handling.

Key Procedures and Functions

The package exposes eleven documented procedures and functions organized around the work request lifecycle:

  • CREATE_WORK_REQUEST — The principal creation routine. It accepts asset, asset group, priority, request-by date, request log, owning department, user, and work request type identifiers, along with maintenance object and linear asset references, and persists a new work request record.
  • UPDATE_WORK_REQUEST — Modifies an existing work request, applying the same validation and API error-handling framework as creation.
  • VALIDATE_WORK_REQUEST — Performs the business rule and referential validation of work request data prior to insertion or update.
  • AUTO_APPROVE_CHECK — Evaluates whether a work request qualifies for automatic approval based on organization-level maintenance defaults and setup.
  • CREATE_AND_APPROVE — Combines creation and approval into a single operation, used when the workflow does not require a separate manual approval step.
  • RETURN_DEPT_ID — Resolves the appropriate department identifier, typically from the owning department or organizational default.
  • CHECK_PRODUCT_INSTALL — Verifies whether the relevant EAM product or module is installed and licensed before allowing the operation.
  • DFF_PROMPT_NAME and VALIDATE_DESC_FLEX_FIELD — Support descriptive flexfield prompt retrieval and validation of flexfield segment values attached to the work request.
  • ISDIFFERENT and ISDIFFERENT_NUMBER — Utility comparison functions used to detect whether character or numeric attribute values have changed, supporting efficient update logic.

Tables Accessed

The package reads and writes a focused set of EAM and shared tables. The transactional core is WIP_EAM_WORK_REQUESTS and its sequence-backed table WIP_EAM_WORK_REQUESTS_S, with additional narrative text held in WIP_EAM_WORK_REQ_NOTES and WIP_EAM_WORK_REQ_NOTES_S. Asset and item context comes from CSI_ITEM_INSTANCES and MTL_SYSTEM_ITEMS. Organizational setup and defaulting logic draws on EAM_ORG_MAINT_DEFAULTS and WIP_EAM_PARAMETERS. Department resolution uses BOM_DEPARTMENTS, user identity comes from FND_USER, and flexfield metadata is read from FND_DESCR_FLEX_CONTEXTS and FND_APPLICATION. DUAL supports scalar queries and default value retrieval.

Usage Notes

This package is invoked from the EAM Work Request entry form, from concurrent programs that process or approve maintenance requests in batch, and from custom extensions that programmatically raise work requests. Because it is a private API, Oracle does not guarantee its signature across patches; developers extending EAM functionality should generally prefer the corresponding public or form-based entry points. The two dependent packages that reference it reinforce its role as a shared internal service layer for the EAM work request domain. When integrating, callers must supply a valid p_org_id and observe the standard API error stack returned through x_msg_count and x_msg_data.