Manage hcm position hierarchy

From oracle/Fusion-Setup-Configuration-Registry · View interactive version

Manage hcm position hierarchy is an AI agent skill from the GitHub repository oracle/Fusion-Setup-Configuration-Registry. Reads an effective HCM position hierarchy and performs approved hierarchy relationship changes through core.data-loader using the Position Hierarchy business object.

How to use this skill

Skill file

Manage HCM Position Hierarchy Setup Task Guidance

Purpose

View an effective HCM position hierarchy from a selected ancestor and manage

its parent-child relationships without a state-changing direct REST call.

Reads use Fusion REST resources. Every create, edit, move, remove, or delete

mutation uses core.data-loader; underlying Position CRUD is delegated to

hcm.global-human-resources.positions.manage-positions, which also uses

core.data-loader.

Task Overview

Use this task to plan and govern Manage HCM Position Hierarchy configuration in Global Human Resources.

What a Position Hierarchy Is

An HCM position hierarchy is the effective-dated graph formed by each

Position's relationship to its parent Position. A hierarchy node is a Position;

the PositionHierarchy record is only the edge from one existing child to one

existing parent. The child is identified by BusinessUnitName plus

PositionCode, and the parent by ParentBusinessUnitName plus

ParentPositionCode. Surrogate Position IDs or explicit source keys are valid

alternatives when the live template and core.data-loader key rules permit

them.

The relationship can drive assignment-manager synchronization. A hierarchy

change can therefore affect the manager inherited by assignments, and the

Synchronize Person Assignments from Position process may be required after

the load. HCM Data Loader automatically triggers hierarchy flattening unless

the submitted DAT explicitly disables that process; this task never adds such

a disabling instruction.

Ownership Boundary

| Concern | Owner and route |

|---|---|

| Resolve an ancestor or parent reference | positionsLov REST read |

| Read descendants | Redwood positionSearches read operation and local tree construction |

| Resolve effective Position details, current parent, or verification | positionsV2 REST read |

| Add, change, move, or end-date a parent-child relationship | core.data-loader, Business Object Position Hierarchy |

| Create, duplicate, edit, inactivate, or delete a Position | Manage Positions through core.data-loader, Business Object Position |

| Direct REST POST, PATCH, DELETE, upsert, or ADF batch mutation | Unsupported |

positionSearches uses POST as a search operation; it is read-only task

behavior and is not a CRUD mutation. Call only the declared POST; it has no

describe operation.

Supported Operations

| Operation | Business effect | Execution route |

|---|---|---|

| view_hierarchy | Show one ancestor and all validated descendants as of one date | REST reads only |

| build_hierarchy | Add one relationship row for every non-root existing Position | One Position Hierarchy XLSX load |

| add_existing_child | Link an existing Position directly beneath an existing parent | One Position Hierarchy row |

| move_position with children | Change the selected Position's parent; its child relationships remain unchanged | One Position Hierarchy row |

| move_position without children | Move the selected Position and reparent each direct child to the original parent | One Position Hierarchy XLSX containing all affected rows |

| remove_from_hierarchy | End-date the selected relationship and, when needed, move its direct children to the grandparent | One Position Hierarchy XLSX containing all affected rows |

| create_child_position | Create a new Position and link it to the selected parent | One combined ZIP containing Position.dat and PositionHierarchy.dat |

| duplicate_position | Create a sanitized copy with a new name/code and link it | One combined ZIP containing Position.dat and PositionHierarchy.dat |

| edit_position | Change Position attributes; include a Position Hierarchy load only when the parent changes | Manage Positions, plus relationship load when applicable |

| delete_position | Delete a Position only when it has no incumbents and no child Positions | Manage Positions through core.data-loader |

Deleting or end-dating a PositionHierarchy relationship never deletes the

underlying Position. Do not translate remove_from_hierarchy into

delete_position, or the reverse.

Conditional Resource Read Order

  1. For a Position create or edit with no parent relationship change, delegate directly to Manage Positions; do not read hierarchy resources or generate hierarchy data.
  2. Read ora-resource/ora_input_validation.md for every hierarchy request.
  3. Read ora-resource/ora_dependency_readiness.md before a hierarchy read or mutation.
  4. Read ora-resource/ora_reference_lookups.md whenever a Position or relationship must resolve or be verified.
  5. Read ora-resource/ora_defaulting_rules.md only when the view date or optional workbook values are absent.
  6. Read ora-resource/ora_design_enforcement.md before authoring or previewing a mutation workbook.
  7. Read ora-resource/ora_error_handling.md before routing a mutation and whenever execution is not conclusively verified.
  8. Read core/data-loader/SKILL.md and its selected references before generating, previewing, or loading an XLSX.

Hierarchy Read Algorithm

  1. Require a Position name or code and resolve one asOfDate; default only a

read-only view to today's date.

  1. Call GET /hcmRestApi/resources/latest/positionsLov with

effectiveDate={asOfDate},

fields=PositionId%2CPositionName%2CPositionCode%2CJobName%2CDepartmentName%2CBusinessUnitId%2CDepartmentId,

finder=findByWord%3BActiveStatus%3DA%2CFilterAttributes%3DPositionName%20PositionCode%20JobName%20DepartmentName%2CSearchTerms%3D{urlEncodedPositionTerm},

onlyData=true, limit=25, and offset=0.

  1. Use the sole row or require the user to choose from at most the first five

candidates. Extract the selected row's exact PositionCode.

  1. POST to /hcmRestApi/redwood/11.13.18.05/positionSearches with

{"filters":[{"name":"AncestorPositionCode","terms":["<resolved PositionCode>"]},{"name":"EffectiveDate","value":"<asOfDate>"}]}.

Follow every supported result page.

  1. Create the root from the selected positionsLov row even when the search

response omits it. Index descendants by PositionId, join them with

ParentPositionId, and use a unique parent name/code only when an ID is

absent.

  1. Reject duplicate IDs, incomplete pagination, cycles, multiple parents,

unresolved parents, and disconnected descendants. Never infer a parent from

response order.

  1. Render through four descendant levels and name every continuation node.

Retain the full validated graph for mutation checks.

Position Hierarchy XLSX Contract

At runtime, generate the editable sample from live metadata with

core.data-loader for Business Object Position Hierarchy. Preserve its

single PositionHierarchy sheet and all live headers. The confirmed template

contains these relationship fields:

PositionId

ParentBusinessUnitId, or ParentPositionId

Prefer the documented name-based user-key pairs. When a Business Unit ID is

supplied, resolve it to the same current Business Unit and reject conflicts

with a supplied name. Leave surrogate IDs and GUID blank when user keys resolve

uniquely. Accept a supplied PositionHierarchyId or GUID only when it exactly

matches the current relationship read; otherwise stop. Do not invent source

keys, copy them from an example, or provide only one member of the source-key

pair. Use YYYY/MM/DD in Data Loader cells.

Every Position referenced in a relationship row must either already exist in

the target environment or be created by Position.dat in the same combined

ZIP. The Position must be effective for the complete requested relationship

range when PositionHierarchy.dat is processed. Set the relationship end date

no later than the first applicable child or parent effective-row end date.

Display 4712/12/31 as End Of Time to the user.

XLSX Row Algorithms

| Intent | Rows to author on PositionHierarchy |

|---|---|

| Build a hierarchy | One row per non-root Position, ordered by depth from the root. Fill child Business Unit/code, parent Business Unit/code, effective start, and bounded effective end. |

| Add an existing child | One row for the child and selected parent beginning on the approved effective date. |

| Move with children | One row for the selected Position and destination parent. Do not add rows for its direct children, so their parent remains the selected Position. |

| Move without children | First row: selected Position to destination parent. Additional row per snapshotted direct child: child to the selected Position's original parent. Use one approved effective date for all rows. |

| Remove from hierarchy, leaf | If the removal date is later than the earliest relationship start, use MERGE and end-date it on the prior day. If both dates match, use DELETE for the complete relationship. |

| Remove from hierarchy, with children | Apply the same relationship-removal rule and add one reparent row per direct child to the selected Position's original parent. |

For a move, require the user to choose with_children or without_children;

never infer it. For a removal with children, the grandparent is the automatic

destination. A root without a parent relationship cannot use this removal

algorithm. Resolve the complete relationship history through positionsV2.

Reject a removal date before its earliest start; use MERGE when it is later

and DELETE|PositionHierarchy only when it matches that earliest start.

A multi-row XLSX is one review and one load, but HCM Data Loader row processing

is not treated as transactional. Record the intended result for every row,

verify all affected relationships after completion, and never retry an

uncertain or partially successful load automatically.

Create, Duplicate, Edit, and Delete Sequence

PositionHierarchy cannot itself create a Position. For

create_child_position or duplicate_position:

  1. Snapshot the intended parent and prove the new Position name/code are unique.
  2. Have Manage Positions author and validate a live-metadata Position.xlsx,

including JobId or JobCode with JobSetCode, and LocationId or

LocationCode with LocationSetCode; do not submit it independently.

  1. Author PositionHierarchy.xlsx with the same Business Unit and Position

code as the new Position and the selected parent's confirmed keys.

  1. Pass both XLSX sources as separate --ide-file inputs to one

core.data-loader invocation; do not use a positional source or preview

either workbook separately. Require one immutable combined ZIP containing

Position.dat and PositionHierarchy.dat.

  1. Show one combined preview and fingerprint, obtain one standalone approve,

and submit the unchanged ZIP once. HCM Data Loader processes referenced

business objects before the objects that reference them, so Position is

loaded before Position Hierarchy.

Supersede any accidental standalone preview and rerun the combined preview

in the same turn; do not report it as a blocker.

  1. Verify both results: the new Position exists with the approved attributes

and its hierarchy relationship resolves to the approved parent. Treat a

successful Position with a failed hierarchy relationship as partial

completion; do not automatically retry or delete the Position.

Position attribute edits and Position deletes follow Manage Positions. A

Position delete requires a fresh hierarchy check proving zero child Positions

and an authorized incumbent check proving zero incumbents. If either exists,

move or remove dependencies first and require a new delete preview later.

A Position create or edit with no parent relationship add or change follows

Manage Positions only. Do not resolve a hierarchy parent or create

PositionHierarchy data for that request.

Deterministic Mutation Sequence

Use this order for every relationship mutation:

  1. Intake one supported operation, exact Position selectors, effective date,

and move mode when applicable.

  1. Bind one authenticated environment; never derive it from a supplied link.
  2. When Core Data Loader requires task context, select the matching active Run

Book task and derive its context; do not require a separately persisted

local context artifact.

  1. Resolve each parent reference through positionsLov, then resolve effective

Position details and current relationships through positionsV2.

  1. Read positionSearches only when descendants or cycle evidence is required;

reject no-ops, cycles, stale identities, range gaps, and incomplete graphs.

  1. Generate a fresh live-metadata Position Hierarchy XLSX and fill exactly the

rows required by the applicable algorithm.

  1. Show environment alias, operation, effective range, each affected child,

old parent, new parent, workbook identity, immutable fingerprint, and

verification assertions.

  1. Invoke core.data-loader without upload approval to validate the exact

source and produce its immutable preview. Stop for a later standalone

approve message.

  1. After approval, revalidate the unchanged source and current hierarchy. Any

changed identity, parent, child set, date range, source bytes, or fingerprint

invalidates approval.

  1. Let core.data-loader upload and initiate the approved load once. Do not

call a product CRUD REST endpoint as fallback.

  1. Monitor and classify the Data Loader result using the core skill. On a

failed, partial, timed-out, or uncertain result, refresh state and stop

before any retry.

  1. Refresh affected Positions through positionsV2; repeat positionSearches

only when the operation required graph evidence.

Preflight, Failure, and Redaction

Before a read, preview, or mutation handoff, complete the applicable input,

dependency, lookup, defaulting, and design checks in the task-local

ora-resource/ guidance. On any failure, classify it through

ora_error_handling.md, preserve only the required sanitized diagnostics, and

stop before retry or route substitution. Never print or persist credentials,

tokens, raw payloads, restricted incumbent data, or protected identifiers.

Refusal Rules

new Position either already verified in Fusion or supplied as Position.dat

in the same dependency-ordered combined ZIP.

request. A physical Data Loader DELETE is irreversible, is not supported for

every component, and requires a separately confirmed live delete contract.

unresolved Position.

hierarchy verification.

Uniform Authoring and Read Contract

Implementation Notes

Use the parent functional-area skill for broader Positions sequencing. Track

token usage only when this task writes project artifacts or skill-run records.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.