Search Results migrate_contract_relations
Overview
OKC_REP_CONTRACT_IMP_PVT is a private PL/SQL package in the Oracle E-Business Suite Contracts (OKC) application, owned by APPS and declared with AUTHID CURRENT_USER. It implements the server-side logic that drives the bulk import of contract data into the repository-contracts schema used by Oracle Contracts (formerly Oracle Sales Contracts / ETRM). The package consumes staging rows loaded into the OKC_REP_IMP_* interface tables and transforms them into live contract records held in OKC_REP_CONTRACTS_ALL and its dependent entities — parties, contacts, risks, documents, usages, versions and relationships.
In the context of Oracle EBS 12.1.1 and 12.2.2, the package is the private ("_PVT") execution layer that supports the public import API surface. It is not intended for direct customer invocation; instead it is called by the import public wrapper and by the concurrent process that validates and promotes staged contract data. The package defines error-type constants that classify import failures — CONTRACT, PARTY, DOCUMENT, RISKS, CONTACTS, REVISION and DELETE — which are written to OKC_REP_IMP_ERRORS_T so that users can diagnose rejected staging rows.
Key Procedures and Functions
The documented entry points (20 total) fall into three functional groups.
- Contract creation and population: CREATE_CONTRACT orchestrates creation of a new contract from a staging row. POPULATE_CONTRACT_HDR fills the contract header, while POPULATE_CONTRACT_PARTIES, POPULATE_PARTY_CONTACTS and POPULATE_CONTRACT_RISKS populate the dependent party, contact and risk structures respectively.
- Party and contact maintenance: DELETE_PARTIES removes party rows associated with a contract, and DELETE_PARTY_CONTACTS removes the contacts belonging to those parties. VALIDATE_AND_INSERT_CON_CP validates and inserts contract-party associations, supporting the user query term delete_parties by handling the inverse retention logic.
- Contract lifecycle and versioning: DELETE_CONTRACT and DELETE_CANCEL_CONTRACT terminate or cancel a contract; CANCEL_CONTRACT performs cancellation; CREATE_NEW_CONTRACT_VERSION generates a revision; CHECK_CONTRACT_EXISTS verifies presence of a contract before processing; ACTIVATE_TASKS_CLOSEOUT closes out associated tasks; and MIGRATE_CONTRACT_RELATIONS moves contract relationship data.
The package also declares global constants such as G_PKG_NAME, G_APP_NAME, G_STATUS_SIGNED and the FND_API return-status values used for standardized error propagation.
Tables Accessed
The package reads staging data from OKC_REP_IMP_CONTRACTS_T and its sequence OKC_REP_IMP_CONTRACTS_T_S, OKC_REP_IMP_PARTIES_T and OKC_REP_IMP_PARTIES_T_S, OKC_REP_IMP_CONTACTS_T and OKC_REP_IMP_CONTACTS_T_S, and OKC_REP_IMP_DOCUMENTS_T. Import run identity is derived from OKC_REP_IMPORT_RUN_ID_S. Errors are logged to OKC_REP_IMP_ERRORS_T.
It writes live data to OKC_REP_CONTRACTS_ALL, OKC_REP_CONTRACT_VERS, OKC_REP_CONTRACT_USAGES and OKC_REP_CONTRACT_USAGES_S, and OKC_REP_CONTRACT_RELS. HR_ALL_ORGANIZATION_UNITS is referenced to resolve internal organization parties.
Usage Notes
OKC_REP_CONTRACT_IMP_PVT is invoked indirectly by the Oracle Contracts import concurrent program and by the public import API, never directly by end users. Two other packages in the EBS schema reference it, confirming its role as a subordinate implementation unit. Customizations should call the public import interface, not this private package, because its signature may change between patch levels (the header reflects a 120.0.12020000.7 revision). When troubleshooting rejected imports — including the deletion of party rows — inspect OKC_REP_IMP_ERRORS_T, where records are categorized using the G_IMP_* error-type constants declared in this package.