onElementsChanged Readonly

onElementsChanged: BeEvent<(changes: TxnChangedEntitiesWithMetadata) => void> = ...

Called after validation completes from saveChanges. The argument to the event holds the list of elements that were inserted, updated, and deleted. Each changed entity includes its id, classId, and metadata. Use metadata.classFullName for an exact class match or metadata.is to match a class or one of its subclasses.

@example

iModel.txns.onElementsChanged.addListener((changes) => { for (const change of changes.inserts) { if (change.metadata.classFullName === "MySchema:MyElement") invalidateCache(); } for (const change of changes.updates) { if (change.metadata.is("BisCore:GeometricElement")) invalidateGeometryCache(change.id); } });

@note If there are many changed elements in a single Txn, the notifications are sent in batches so this event may be called multiple times per Txn.

Defined in

Last Updated: 03 September, 2026