Search Results check_pm_program_effectivity
Overview
OKS_PM_PROGRAMS_PVT is a private (PVT) PL/SQL package in the APPS schema that encapsulates the core business logic for Preventive Maintenance (PM) programs within Oracle Enterprise Asset Management (eAM) and the Service/Contracts (OKS) module. In Oracle EBS 12.1.1 and 12.2.2, PM programs define recurring maintenance schedules attached to contract or service lines—such as those created for warranties, service agreements, or asset maintenance contracts. This package provides the internal engine that generates, adjusts, renews, and validates those schedules, along with the supporting operations for versioning, migration, and history management.
Because it is a private package, it is not exposed as a public API. The header declares only global constants and type definitions—including pms_rec_type, pms_tbl_type, act_rec_type, pmsch_refresh_rec_type, and pmsch_refresh_tbl_type—that carry schedule records and activity data through the internal procedures. The public-facing entry points for PM functionality are typically found in the corresponding OKS_PM_PROGRAMS (or OKS_PMS) wrapper packages and their UI/Concurrent counterparts, which delegate the heavy lifting to this private package.
Key Procedures and Functions
The package exposes 20 documented procedures and functions. Their purposes, based on the ETRM metadata and the PM domain model, are:
- GENERATE_SCHEDULE — Creates the initial set of preventive maintenance schedule rows for a PM program based on its rule definition and frequency.
- RENEW_PM_PROGRAM_SCHEDULE — Extends an existing PM program by generating additional future schedule dates when the current program nears expiry.
- ADJUST_PM_PROGRAM_SCHEDULE — Modifies existing schedule entries, for example when a program’s interval or start date changes.
- UPDATE_PMP_RULE_ID — Updates the program-level rule identifier associated with a PM program.
- REFRESH_PM_PROGRAM_SCHEDULE — Recalculates and re-populates schedule records, typically after rule or configuration changes, using the
pmsch_refresh_rec_typestructure. - POPULATE_SCHEDULE — Bulk-inserts generated schedule records into OKS_PM_SCHEDULES.
- MIGRATE_TO_PROGRAM and MIGRATE_TO_ACTIVITIES — Migrate PM data into program/activity structures, supporting upgrades or conversion of legacy maintenance definitions.
- CHECK_PM_MATCH — Validates that a PM definition matches its source contract line or template.
- CHECK_PM_SCHEDULE — Validates the generated schedule for internal consistency.
- CHECK_PM_PROGRAM_EFFECTIVITY — Determines whether a PM program is currently effective (within its start and end dates) and whether schedule generation is permitted; this is the procedure most directly invoked by callers searching for effectivity validation.
- CHECK_PM_REQUIRED_VALUES — Enforces mandatory field checks, raising the
G_REQUIRED_VALUEexception pattern. - CHECK_PM_NEW_ACTIVITIES — Verifies that newly added PM activities are valid before they are persisted.
- UNDO_PM_LINE and INIT_OKS_K_LINE — Reverse or initialize PM-related contract/service line data.
- VERSION_PM and RESTORE_PM — Support versioning of PM programs and restoration of a prior version.
- DELETE_PMHISTORY and DELETE_PMSAVED_VERSION — Remove historical or saved-version data.
- COPY_PM_TEMPLATE — Duplicates a PM template into a new PM program.
Tables Accessed
The package reads and writes the principal PM tables: OKS_PM_ACTIVITIES and OKS_PM_SCHEDULES, with their history tables OKS_PM_ACTIVITIES_H and OKS_PM_SCHEDULES_H, and the structure tables OKS_PM_STREAM_LEVELS and OKS_PM_STREAM_LEVELS_H. It also touches OKS_K_LINES_B and OKC_K_LINES_B (contract/service lines), OKC_RULES_B (PM rules), AHL_MR_HEADERS_B (maintenance work orders), and the OKC_CLASS_OPERATIONS, OKC_OPERATION_INSTANCES, OKC_OPERATION_LINES, and OKC_SUBCLASSES_B tables used during migration and validation. PLITBLM is used as a standard PL/SQL table helper.
Usage Notes
Because OKS_PM_PROGRAMS_PVT is a private package, it should not be called directly from custom code; Oracle advises using the documented public APIs in the OKS/OKC layer instead. In standard EBS flows it is invoked indirectly from the Preventive Maintenance forms, the Service Contracts forms, and from concurrent programs that generate or renew PM schedules. It is referenced by twelve other packages, confirming its role as a shared internal engine. Customizations that require PM effectivity checks, schedule generation, or version management should call the corresponding public wrapper rather than this private package, as the internal interfaces may change between releases.