Changing Legal Employer or Work Type Using Cancel Work Relationship

One of the most common challenges in Oracle Fusion HCM is correcting an employee's Legal Employer or Work Type after the worker has already been hired.

Since these attributes are tied to the Work Relationship, Oracle does not provide a straightforward update mechanism to modify them directly. In such scenarios, the recommended approach is often:

  1. Cancel the existing Work Relationship.
  2. Recreate the worker with the correct values.
  3. Restore historical records that were removed during the cancellation process.

This article explains a developer-centric approach using HDL, supported SQLs, and backup templates to safely perform the activity while maintaining the ability to restore records if required.


Why Is Backup Important?

When a Work Relationship is cancelled, Oracle removes multiple records associated with the worker, including:

  • Work Relationships
  • Assignments
  • Work Terms
  • Seniority Dates
  • Salary Records
  • Other employment-related objects

Before performing the cancellation, it is essential to extract and preserve all affected records.

The backup serves two purposes:

  • Recreating historical data after rehiring.
  • Restoring records if the cancellation needs to be reversed.

Solution Overview

The overall process consists of four phases:

Phase 1 – Extract Existing Worker Data

Execute these SQL scripts to extract all worker-related information.

The extraction should include:

  • Work Relationship
  • Assignment
  • Contract
  • Work Terms
  • Salary

Store the output securely before proceeding.


Phase 2 – Generate HDL Backup Files

Using the extracted data:

  1. Use this XSL Template and generate the HDL DAT file using BIP Report
  2. Apply required changes as needed e.g. update legal employer/ worker type

These HDL files act as a complete backup of the worker's employment data.

This makes future recovery activities significantly easier.


Phase 3 – Cancel and Recreate the Work Relationship

Once the backup is validated:

  1. Navigate to Person Management.
  2. Cancel the Work Relationship.
  3. Create a new Work Relationship with:
    • Correct Legal Employer
    • Correct Work Type
  4. Complete the hiring process.

If you want to perform the cancel work relationship via HDL then below is the sample HDL

METADATA|WorkRelationship|PersonNumber|WorkerType|DateStart|PrimaryFlag|LegalEmployerName|ActionCode|ReasonCode|PersonId(SourceSystemId)|SourceSystemId|SourceSystemOwner|CancelWorkRelationshipFlag
DELETE|WorkRelationship|123|E|2026/01/01|Y|Legal_Employer_Name|HIRE||PERSON123|WR123|HDL|Y


Phase 4 – Restore Historical Data Through HDL

After the new Work Relationship has been created:

  1. Update the generated HDL files with:
    • New Assignment Number (if applicable)
    • New Work Relationship identifiers
    • Any required source keys
  2. Load the HDL files in the recommended sequence.

Typical order:

  1. Work Relationship
  2. Work Terms
  3. Assignment
  4. Contract
  5. Salary

Recovery Scenario: Restoring Cancelled Records

Occasionally a Work Relationship may be cancelled by mistake.

If backup HDL files were generated before cancellation, recovery becomes significantly easier.

The recovery process typically involves:

  1. Recreating the Work Relationship.
  2. Updating HDL references.
  3. Reloading the backed-up business objects.
  4. Validating employment history.

Without a backup, reconstruction becomes a manual and time-consuming effort.


Key Technical Considerations

Source Keys

Maintain source keys wherever possible.

This helps HDL identify records correctly and reduces duplicate creation issues.

Assignment Numbers

A new Work Relationship often generates a new Assignment Number.

Any backup files referencing the old assignment must be reviewed before loading.

Load Sequence

The most common reason for HDL failures during restoration is incorrect object sequencing.

Always load parent objects before dependent objects.

Validation

After restoration, verify:

  • Assignment history
  • Salary history
  • Grade progression
  • Seniority dates
  • Reporting hierarchy
  • Security access

Best Practices

  • Always generate HDL backups before cancellation.
  • Store extraction files in a secure repository.
  • Validate HDL files in a lower environment first.
  • Keep a copy of both extracted data and generated DAT files.
  • Document new Assignment Numbers and Work Relationship identifiers.
  • Test restoration procedures before performing production activities.

Conclusion

Changing Legal Employer or Work Type in Oracle Fusion often requires cancelling and recreating the Work Relationship. While the process is straightforward from a functional perspective, preserving historical employment data requires careful planning.

By extracting worker records using supported SQLs, generating HDL backup files through the provided templates, and maintaining a documented restoration process, technical consultants can safely perform these corrections while retaining the ability to recover data whenever necessary.

 

Comments

Popular posts from this blog

Load Salaries with Pay Rate Components in Oracle HCM HDL