event

Object Class Parent Graph Changed

Parent edges in the ObjectClass tree changed. Four handlers reconcile derived state for the affected subtrees.

EventStatus: Implemented in api-v1

Purpose

Published after the single-parent ObjectClass tree is restructured — create-root, add-child, move, merge, copy, or delete. Everything derived from tree position (hierarchy fields, classification inheritance, Revit categories, rendered parameter templates) is stale until the handlers run, so this event has more subscribers than any other in the module.

It is the real successor to ObjectCategoryHierarchyChanged, an event this catalog previously documented that was never implemented in apps/api-v1.

Payload

Envelope is { name, occurredAt, payload } (apps/api-v1/src/modules/shared/domain/events/DomainEvent.ts).

FieldTypeMeaning
affectedObjectClassIdsreadonly string[]De-duplicated domain_id seeds for the changed subtrees. Deleted seeds stay in the payload so handlers can skip missing rows instead of recomputing the whole tree
changedAtDateWhen the mutation happened; combined with the sorted ids to form each handler’s idempotency key

Raised by

  • Factory objectClassParentGraphChangedapps/api-v1/src/modules/bim-ontology/core/domain/object-class/ObjectClass.events.ts, which de-duplicates the id list
  • Dispatched by ObjectClassWorkflowUseCases.dispatchParentGraphChangedapps/api-v1/src/modules/bim-ontology/core/application/use-cases/ObjectClassWorkflowUseCases.ts — reached from createRoot and addChild directly and from runGraphMutation for delete, move, merge, and copy
  • HTTP: createObjectClass, addObjectClassChild, moveObjectClasses, mergeObjectClasses, copyObjectClasses, deleteObjectClasses

Consumers

Four handlers, all in adapters/inbound/events/ and all registered in bim-ontology.composition.ts:

HandlerEffect
ObjectClassParentGraphChangedRevitCategoryHandlerRe-runs ReconcileObjectClassRevitCategoriesUseCase for the affected subtrees, then PersistDerivedRevitCategorySetsUseCase to refresh derived projection category sets
ObjectClassParentGraphChangedHierarchyHandlersyncHierarchy — recomputes depth, path, is_leaf, and root object class
ObjectClassParentGraphChangedClassificationHandlersyncClassificationInheritance per affected id (Uniformat / Masterformat / ObjectClass code), then DemoteObjectClassesThatLostClassificationUseCase for approved nodes that lost a required kind. Demote records ObjectClassDemoted after persist
RenderedParamTemplatesSyncHandlerSyncObjectClassRenderedParamTemplatesUseCase per surviving seed with recomputeSubtree, re-materializing inherited ClassParameter rows

All four seed from affectedObjectClassIds rather than recomputing the whole tree (ADR-0047) — whole-tree recompute stays on the explicit syncAll* maintenance endpoints. Each is idempotent on sorted ids plus changedAt, skips not-found seeds, and records failures through ForRecordingBimOntologyHandlerFailure before rethrowing.