IModelTransformer Class

Beta

Base class used to transform a source iModel into a different target iModel.

see iModel Transformation and Data Exchange, IModelExporter, IModelImporter

Extends

Methods

Name Description
constructor(source: IModelDb | IModelExporter, target: IModelDb | IModelImporter, options?: IModelTransformOptions): IModelTransformer Construct a new IModelTransformer  
detectElementDeletes(): void Detect Element deletes using ExternalSourceAspects in the target iModel and a brute force comparison against Elements in the source iModel.  
detectRelationshipDeletes(): void Detect Relationship deletes using ExternalSourceAspects in the target iModel and a brute force comparison against relationships in the source iModel.  
dispose(): void Dispose any native resources associated with this IModelTransformer.  
hasElementChanged(sourceElement: Element, targetElementId: Id64String): boolean Protected Returns true if a change within sourceElement is detected.  
initFromExternalSourceAspects(): void Initialize the source to target Element mapping from ExternalSourceAspects in the target iModel.  
onDeleteElement(sourceElementId: Id64String): void Protected Override of IModelExportHandler.onDeleteElement that is called when IModelExporter detects that an Element has been deleted from the source iModel.  
onDeleteModel(_sourceModelId: Id64String): void Protected Override of IModelExportHandler.onDeleteModel that is called when IModelExporter detects that a Model has been deleted from the source iModel.  
onDeleteRelationship(sourceRelInstanceId: Id64String): void Protected Override of IModelExportHandler.onDeleteRelationship that is called when IModelExporter detects that a Relationship has been deleted from the source iModel.  
onExportCodeSpec(sourceCodeSpec: CodeSpec): void Protected Override of IModelExportHandler.onExportCodeSpec that imports a CodeSpec into the target iModel when it is exported from the source iModel.  
onExportElement(sourceElement: Element): void Protected Override of IModelExportHandler.onExportElement that imports an element into the target iModel when it is exported from the source iModel.  
onExportElementMultiAspects(sourceAspects: ElementMultiAspect[]): void Protected Override of IModelExportHandler.onExportElementMultiAspects that imports ElementMultiAspects into the target iModel when they are exported from the source iModel.  
onExportElementUniqueAspect(sourceAspect: ElementUniqueAspect): void Protected Override of IModelExportHandler.onExportElementUniqueAspect that imports an ElementUniqueAspect into the target iModel when it is exported from the source iModel.  
onExportFont(font: FontProps, _isUpdate: boolean | undefined): void Protected Override of IModelExportHandler.onExportFont that imports a font into the target iModel when it is exported from the source iModel.  
onExportModel(sourceModel: Model): void Protected Override of IModelExportHandler.onExportModel that is called when a Model should be exported from the source iModel.  
onExportRelationship(sourceRelationship: Relationship): void Protected Override of IModelExportHandler.onExportRelationship that imports a relationship into the target iModel when it is exported from the source iModel.  
onTransformElement(sourceElement: Element): ElementProps Protected Transform the specified sourceElement into ElementProps for the target iModel.  
onTransformElementAspect(sourceElementAspect: ElementAspect, targetElementId: Id64String): ElementAspectProps Protected Transform the specified sourceElementAspect into ElementAspectProps for the target iModel.  
onTransformModel(sourceModel: Model, targetModeledElementId: Id64String): ModelProps Protected Transform the specified sourceModel into ModelProps for the target iModel.  
onTransformRelationship(sourceRelationship: Relationship): RelationshipProps Protected Transform the specified sourceRelationship into RelationshipProps for the target iModel.  
processAll(): void Export everything from the source iModel and import the transformed entities into the target iModel.  
processChanges(requestContext: AuthorizedClientRequestContext, startChangeSetId?: GuidString): Promise<void> Export changes from the source iModel and import the transformed entities into the target iModel.  
processChildElements(sourceElementId: Id64String): void Import child elements into the target IModelDb  
processCodeSpec(codeSpecName: string): void Cause a single CodeSpec to be exported from the source iModel and imported into the target iModel.  
processCodeSpecs(): void Cause all CodeSpecs to be exported from the source iModel and imported into the target iModel.  
processDeferredElements(numRetries: number = 3): void Import elements that were deferred in a prior pass.  
processElement(sourceElementId: Id64String): void Cause the specified Element and its child Elements (if applicable) to be exported from the source iModel and imported into the target iModel.  
processFonts(): void Cause all fonts to be exported from the source iModel and imported into the target iModel.  
processModel(sourceModeledElementId: Id64String): void Cause the model container, contents, and sub-models to be exported from the source iModel and imported into the target iModel.  
processModelContents(sourceModelId: Id64String, targetModelId: Id64String, elementClassFullName: string = Element.classFullName): void Cause the model contents to be exported from the source iModel and imported into the target iModel.  
processRelationships(baseRelClassFullName: string): void Imports all relationships that subclass from the specified base class.  
processSchemas(requestContext: ClientRequestContext | AuthorizedClientRequestContext): Promise<void> Cause all schemas to be exported from the source iModel and imported into the target iModel.  
processSubject(sourceSubjectId: Id64String, targetSubjectId: Id64String): void Recursively import all Elements and sub-Models that descend from the specified Subject  
shouldExportCodeSpec(_sourceCodeSpec: CodeSpec): boolean Protected Override of IModelExportHandler.shouldExportCodeSpec that is called to determine if a CodeSpec should be exported from the source iModel.  
shouldExportElement(_sourceElement: Element): boolean Protected Override of IModelExportHandler.shouldExportElement that is called to determine if an element should be exported from the source iModel.  
shouldExportElementAspect(_sourceAspect: ElementAspect): boolean Protected Override of IModelExportHandler.shouldExportElementAspect that is called to determine if an ElementAspect should be exported from the source iModel.  
shouldExportRelationship(_sourceRelationship: Relationship): boolean Protected Override of IModelExportHandler.shouldExportRelationship that is called to determine if a Relationship should be exported.  
skipElement(sourceElement: Element): void Protected Mark the specified Element so its processing can be deferred.  

Properties

Name Type Description
_deferredElementIds Protected Set<string> The set of Elements that were deferred during a prior transformation pass.  
context IModelCloneContext The IModelTransformContext for this IModelTransformer.  
exporter IModelExporter The IModelExporter that will export from the source iModel.  
importer IModelImporter The IModelImporter that will import into the target iModel.  
sourceDb IModelDb The read-only source iModel.  
targetDb IModelDb The read/write target iModel.  
targetScopeElementId Id64String The Id of the Element in the target iModel that represents the source repository as a whole and scopes its ExternalSourceAspect instances.  

Defined in

Last Updated: 05 June, 2020