# Manage Hierarchy Types Setup Task Guidance

> Exports or imports the complete Manage Hierarchy Types setup-task data as an unfiltered Oracle Fusion FSM package. Use only for whole-task FSM export/import; route every import through core.data-loader and refuse record-level maintenance, filtered or template exports, and direct REST or loader execution.

- Skill: `oracle/manage-hierarchy-types-setup-task-guidance` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx get-skill add oracle/manage-hierarchy-types-setup-task-guidance`
- Raw SKILL.md: https://api.skillmd.com/api/skills/oracle/manage-hierarchy-types-setup-task-guidance/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: Oracle (https://skillmd.com/u/oracle)
- Updated: 2026-11-18
- Page: https://skillmd.com/skills/oracle/manage-hierarchy-types-setup-task-guidance

---


# Manage Hierarchy Types Setup Task Guidance

## Purpose and Boundary

Use this skill only to export or import the complete FSM setup package for
`Manage Hierarchy Types`. Fix the task identity to `HZ_MANAGE_HIERARCHY_TYPES` under
`Trading Community Foundation`.

Do not use this skill for planning, sequencing, standalone validation, template
generation, filtered exports, or individual hierarchy-type inspection or
maintenance. Validation is permitted only as a mandatory preflight for an
export or import.

## Supported Operations

1. `export`: export every setup-data object owned by the fixed task as one
   unfiltered, non-template FSM package through
   `shared.setup-export.task-level-export`.
2. `import`: import one complete, unchanged FSM ZIP for the fixed task through
   the mandatory `core.data-loader` workflow.

Treat a migration request as these two operations in sequence. Finish and
persist the source export before starting a separate target import preflight
and approval.

## Single-Approval User Experience

For each export or import operation, complete all safe, read-only preparation
before asking the user to approve anything. Intake questions, authentication,
validation, preview generation, and corrections are preparation steps, not
approval gates.

When preparation passes, present one compact execution summary containing the
environment, operation, fixed task name/code, exact scope, artifact path and
SHA-256 when applicable, output path, and side effect. Ask the user to reply
exactly `approve`. That one approval authorizes the one immutable operation
shown in the summary:

- for export, one FSM export submission plus polling and result retrieval;
- for import, one upload and initiation of the validated FSM ZIP.

Pass that approval through the selected shared or core workflow. Do not ask
again at a task-local, Task Hook, adapter, upload, or initiation boundary.
Downstream approval records are internal representations of the same user
approval, not new prompts.

If input is missing, validation fails, the environment is ambiguous, or an
explicit exception is required, stop with a friendly correction or blocker.
Do not label the correction as an approval request. Any change to the approved
environment, task, scope, archive bytes, hash, output path, or execution options
invalidates the approval and requires a new prepared summary.

## Fixed Task Context

- Pillar: `CX`
- Offering: `Customer Data Management`
- Functional area: `Trading Community Foundation`
- Functional area code: `ORA_HZ_CDM_FOUNDATION`
- Task name: `Manage Hierarchy Types`
- Task code: `HZ_MANAGE_HIERARCHY_TYPES`
- CSV export/import supported: `Y`
- Data Loader import mode: `FSM`

Never accept a task-code, offering, or functional-area override.

## Whole-Task FSM Export

1. Require `project_id` and the named source Fusion environment. Complete
   authentication, environment identity, privilege, live exact-task lookup,
   `CSVExportImportSupportedFlag=Y`, destination-path, and overwrite checks
   as read-only preflight; fail closed on a mismatch or blocker.
2. Fix `template_only=false` and `export_criteria=[]`. Refuse every filter,
   business-object subset, and template/specification request.
3. Build the single execution summary with the source environment, task
   name/code, unfiltered whole-task scope, output directory, and one-process
   impact. Ask exactly once for `approve`; do not ask for approval during
   discovery, authentication, validation, or output preparation.
4. Invoke `shared.setup-export.task-level-export` exactly once with the fixed
   context. Use its shared FSM engine for submission, polling, ZIP or
   `ProcessLog` retrieval, and packaging; do not implement task-local REST.
   Run the approved command with unbuffered output:

   ~~~bash
   python3 -u shared/setup-export/task-level-export/scripts/export_setup_task_csv.py \
     --data \
     --task-code HZ_MANAGE_HIERARCHY_TYPES \
     --offering-name "Customer Data Management" \
     --functional-area-name "Trading Community Foundation" \
     --project-id "{project_id}" \
     --output-dir project/{project_id}/exports/customer-data-management/trading-community-foundation/manage-hierarchy-types/ \
     --token-cache auto \
     --wait-seconds 300 \
     --poll-interval 10
   ~~~

   If the command runner yields a session or cell identifier, wait on that same
   process until it exits. The `-u` option exposes the shared exporter's
   `Started ... process: <ProcessId>` line without changing shared code.
   Capture that identifier in the task skill's run record. Empty initial output
   is not failure and must not trigger a replacement export.
5. Persist the `ProcessId` as soon as it is returned. On success, verify the ZIP,
   calculate SHA-256, store it in the declared export directory, register it,
   and update project state.
6. On timeout, preserve the same `ProcessId`, last status, and elapsed time.
   Resume only that process after a later request; never submit a replacement
   export automatically.

## Whole-Task FSM Import Through Data Loader

1. Require `project_id`, the named target Fusion environment, and one explicit
   ZIP path. Complete authentication, target identity, privilege, route, and
   source-path checks as read-only preflight. Reject loose CSV files, multiple
   archives, and directory scans.
2. Verify that the file is a readable ZIP containing exactly one member whose
   basename is `ASM_SETUP_CSV_METADATA.xml`, and require its single
   `ObjectShortName` to equal `HZ_MANAGE_HIERARCHY_TYPES`. Preserve the archive
   byte for byte and calculate its SHA-256.
3. Invoke `core.data-loader` with the fixed task context and
   `dataloader_import_mode=FSM`. Let Data Loader own source review, task
   validation, FSM adapter selection, immutable preview creation,
   upload/initiation, and user-friendly reporting. Run Data Loader's dedicated
   validation-only helper first. This helper has no upload or initiation path:

   ~~~bash
   python3 core/data-loader/scripts/validate_data_load_file.py \
     "{setup_data_zip_path}" \
     --project-root project/{project_id} \
     --output-zip project/{project_id}/artifacts/core/data-loader/current/mapping-reviews/reviewed-manage-hierarchy-types.zip \
     --token-cache auto
   ~~~

   Require its reviewed ZIP to remain byte-identical to the supplied FSM ZIP
   and treat that reviewed path as `reviewed_setup_data_zip_path`. If its hash
   differs from the supplied archive, stop with `artifact_persistence`; do not
   approve or import either file.

   Next resolve the selected task's rules only through Task Hook:

   ~~~bash
   python3 core/data-loader/task-hook/scripts/task_hook.py data-load \
     --task-context "{task_context_path}" \
     --task-name "Manage Hierarchy Types" \
     --sequence "{task_sequence}"
   ~~~

   Evaluate the returned ordered rule resources, then call Task Hook's
   `build-data-load-preview --input-stdin`. Bind `finalData` to
   `executionRoute=data-loader`, `sourceType=FSM`, the exact target environment,
   task code/name, absolute reviewed archive path, reviewed archive SHA-256, and
   `wholeTask=true`. Persist the returned preview under the project workspace.
   Do not call `approve-data-load-preview`,
   `verify-approved-data-load-archive`, `upload_and_initiate.py`, UCM, or any
   import endpoint during preflight.
4. After every preflight check passes, display one user-friendly execution
   summary with the exact target, fixed task name/code, ZIP path and hash,
   whole-task scope, validation status, and configuration-changing impact.
   Ask exactly once for the separate message `approve`; stop before the first
   POST. On that message, pass the persisted preview unchanged to Task Hook's
   `approve-data-load-preview --input-stdin`, then pass its preview and approval
   unchanged to `verify-approved-data-load-archive --input-stdin --archive
   "{reviewed_setup_data_zip_path}"`. Persist the returned
   `taskValidationEnvelope`, verify the reviewed archive hash again, and
   immediately use Data Loader's approved task-routed command without another
   prompt:

   ~~~bash
   python3 core/data-loader/scripts/upload_and_initiate.py "{reviewed_setup_data_zip_path}" \
     --task-routed \
     --task-validation-envelope "{task_validation_envelope_path}" \
     --approve-upload
   ~~~
5. Do not use `upload_and_initiate.py` as a preflight command. Do not invoke
   `setupTaskCSVImports`, a shared import script, UCM upload, or a product
   adapter directly from this skill. Do not use an approval prompt to waive a
   validation problem: resolve it or report a blocker before the single
   execution summary. Any changed target, supplied or reviewed archive bytes,
   task context, or execution option invalidates approval and restarts Data
   Loader preflight.
6. Persist the accepted execution result and available redacted diagnostics in
   the declared report path. Check status only when the user asks, and never
   resubmit an import while its outcome is uncertain.

## Error and Retry Contract

Classify failures as `input_validation`, `catalog_or_metadata_mismatch`,
`auth_expired_or_invalid`, `authorization_or_privilege`,
`transport_or_environment`, `fusion_api_error`, `process_timeout`,
`process_failed`, `artifact_persistence`, or `approval_blocker`.

- Refresh a cache-managed token once after a read-only 401 or 403. A second
  authentication response blocks execution.
- Never retry an export or import POST automatically. Require a new immutable
  preview and explicit approval before any new submission.
- On timeout or failure, report the environment, operation, task code,
  `ProcessId` or request ID when available, last status, elapsed time,
  diagnostic artifact, and recommended next action.
- Never print or persist tokens, secrets, authorization headers, token-cache
  contents, full Base64 payloads, or sensitive customer data.

## Result Contract

For export, report the source environment, fixed task name/code, `ProcessId`,
status, ZIP or log path, enclosure type, and ZIP SHA-256 when available. For
import, return the complete `core.data-loader` Markdown result and report the
target environment, fixed task name/code, immutable ZIP path and hash, status,
and available process log. Record the skill run and token usage for every
durable project activity.

## Refusal Rules

- Refuse individual hierarchy-type creation, editing, deletion, or inspection.
- Refuse filtered, partial, criteria-based, and template/specification exports.
- Refuse task-code overrides, loose CSV files, edited or repacked ZIPs, and
  packages that Data Loader cannot confirm as the fixed FSM task.
- Refuse direct endpoint, script, or adapter execution that bypasses the
  required approval workflow.

## Golden Scenarios

| Request | Expected route |
|---|---|
| Export all Manage Hierarchy Types setup data from TEST | Approve and run one unfiltered FSM task export; persist the ZIP, hash, and process result |
| Import the complete exported ZIP into UAT | Finish Data Loader and Task Hook preflight, show one immutable-operation summary, request one approval, and submit one FSM import |
| Export only one hierarchy-type | Refuse partial scope without making a Fusion call |
| Create or edit a hierarchy-type | Refuse record-level maintenance without making a Fusion call |

## Sources

- `knowledge/setup-task-catalog/effective/setupTasksAll.json`
- `shared/setup-export/task-level-export/SKILL.md`
- `core/data-loader/SKILL.md`

