Object Class Parent Graph Changed
Parent edges in the ObjectClass tree changed. Four handlers reconcile derived state for the affected subtrees.
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).
| Field | Type | Meaning |
|---|---|---|
affectedObjectClassIds | readonly 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 |
changedAt | Date | When the mutation happened; combined with the sorted ids to form each handler’s idempotency key |
Raised by
- Factory
objectClassParentGraphChanged—apps/api-v1/src/modules/bim-ontology/core/domain/object-class/ObjectClass.events.ts, which de-duplicates the id list - Dispatched by
ObjectClassWorkflowUseCases.dispatchParentGraphChanged—apps/api-v1/src/modules/bim-ontology/core/application/use-cases/ObjectClassWorkflowUseCases.ts— reached fromcreateRootandaddChilddirectly and fromrunGraphMutationfordelete,move,merge, andcopy - HTTP: createObjectClass, addObjectClassChild, moveObjectClasses, mergeObjectClasses, copyObjectClasses, deleteObjectClasses
Consumers
Four handlers, all in adapters/inbound/events/ and all registered in bim-ontology.composition.ts:
| Handler | Effect |
|---|---|
ObjectClassParentGraphChangedRevitCategoryHandler | Re-runs ReconcileObjectClassRevitCategoriesUseCase for the affected subtrees, then PersistDerivedRevitCategorySetsUseCase to refresh derived projection category sets |
ObjectClassParentGraphChangedHierarchyHandler | syncHierarchy — recomputes depth, path, is_leaf, and root object class |
ObjectClassParentGraphChangedClassificationHandler | syncClassificationInheritance per affected id (Uniformat / Masterformat / ObjectClass code), then DemoteObjectClassesThatLostClassificationUseCase for approved nodes that lost a required kind. Demote records ObjectClassDemoted after persist |
RenderedParamTemplatesSyncHandler | SyncObjectClassRenderedParamTemplatesUseCase 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.