TemplateModelCloner Class
IModelTransformer that clones the contents of a template model.
Extends
Methods
Name | Description | |
---|---|---|
constructor(sourceDb: IModelDb, targetDb: IModelDbsourceDb): TemplateModelCloner | Construct a new TemplateModelCloner | |
onTransformElement(sourceElement: Element): ElementProps | Cloning from a template requires this override of onTransformElement. | |
placeTemplate2d(sourceTemplateModelId: string, targetModelId: string, placement: Placement2d): Promise<Map<string, string>> | Place a template from the sourceDb at the specified placement in the target model within the targetDb. | |
placeTemplate3d(sourceTemplateModelId: string, targetModelId: string, placement: Placement3d): Promise<Map<string, string>> | Place a template from the sourceDb at the specified placement in the target model within the targetDb. |
Inherited methods
Name | Inherited from | Description |
---|---|---|
combineElements(sourceElementIds: Id64Array, targetElementId: string): void | IModelTransformer | Combine an array of source elements into a single target element. |
detectElementDeletes(): Promise<void> | IModelTransformer | Detect Element deletes using ExternalSourceAspects in the target iModel and a brute force comparison against Elements |
detectRelationshipDeletes(): Promise<void> | IModelTransformer | Detect Relationship deletes using ExternalSourceAspects in the target iModel and a brute force comparison against relationships in the source iModel. |
dispose(): void | IModelTransformer | Dispose any native resources associated with this IModelTransformer. |
hasElementChanged(sourceElement: Element, _targetElementId: string): boolean Protected | IModelTransformer | Returns true if a change within sourceElement is detected. |
initElementProvenance(sourceElementId: string, targetElementId: string): ExternalSourceAspectProps | IModelTransformer | Create an ExternalSourceAspectProps in a standard way for an Element in an iModel --> iModel transformation. |
initScopeProvenance(): void Protected | IModelTransformer | Make sure there are no conflicting other scope-type external source aspects on the target scope element, |
initialize(args?: InitOptions): Promise<void> | IModelTransformer | Initialize prerequisites of processing, you must initialize with an InitOptions if you |
onDeleteElement(sourceElementId: string): void | IModelTransformer | Override of IModelExportHandler.onDeleteElement that is called when IModelExporter detects that an Element has been deleted from the source iModel. |
onDeleteModel(sourceModelId: string): void | IModelTransformer | Override of IModelExportHandler.onDeleteModel that is called when IModelExporter detects that a Model has been deleted from the source iModel. |
onDeleteRelationship(sourceRelInstanceId: string): void | IModelTransformer | Override of IModelExportHandler.onDeleteRelationship that is called when IModelExporter detects that a Relationship has been deleted from the source iModel. |
onExportCodeSpec(sourceCodeSpec: CodeSpec): void | IModelTransformer | Override of IModelExportHandler.onExportCodeSpec that imports a CodeSpec into the target iModel when it is exported from the source iModel. |
onExportElement(sourceElement: Element): void | IModelTransformer | Override of IModelExportHandler.onExportElement that imports an element into the target iModel when it is exported from the source iModel. |
onExportElementMultiAspects(sourceAspects: ElementMultiAspect[]): void | IModelTransformer | Override of IModelExportHandler.onExportElementMultiAspects that imports ElementMultiAspects into the target iModel when they are exported from the source iModel. |
onExportElementUniqueAspect(sourceAspect: ElementUniqueAspect): void | IModelTransformer | 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): void | IModelTransformer | Override of IModelExportHandler.onExportFont that imports a font into the target iModel when it is exported from the source iModel. |
onExportModel(sourceModel: Model): void | IModelTransformer | Override of IModelExportHandler.onExportModel that is called when a Model should be exported from the source iModel. |
onExportRelationship(sourceRelationship: Relationship): void | IModelTransformer | Override of IModelExportHandler.onExportRelationship that imports a relationship into the target iModel when it is exported from the source iModel. |
onExportSchema(schema: Schema): Promise<void | ExportSchemaResult> | IModelTransformer | Override of IModelExportHandler.onExportSchema that serializes a schema to disk for processSchemas to import into |
onProgress(): Promise<void> | IModelTransformer | This method is called when IModelExporter has made incremental progress based on the progressInterval setting. |
onSkipElement(sourceElementId: string): void | IModelTransformer | Called when element is skipped instead of exported. |
onTransformElementAspect(sourceElementAspect: ElementAspect, _targetElementId: string): ElementAspectProps Protected | IModelTransformer | Transform the specified sourceElementAspect into ElementAspectProps for the target iModel. |
onTransformModel(sourceModel: Model, targetModeledElementId: string): ModelProps | IModelTransformer | Transform the specified sourceModel into ModelProps for the target iModel. |
onTransformRelationship(sourceRelationship: Relationship): RelationshipProps Protected | IModelTransformer | Transform the specified sourceRelationship into RelationshipProps for the target iModel. |
processAll(options?: FinalizeTransformationOptions): Promise<void> | IModelTransformer | Export everything from the source iModel and import the transformed entities into the target iModel. |
processChanges(options: ProcessChangesOptions): Promise<void> | IModelTransformer | Export changes from the source iModel and import the transformed entities into the target iModel. |
processChildElements(sourceElementId: string): Promise<void> | IModelTransformer | Import child elements into the target IModelDb |
processCodeSpec(codeSpecName: string): Promise<void> | IModelTransformer | Cause a single CodeSpec to be exported from the source iModel and imported into the target iModel. |
processCodeSpecs(): Promise<void> | IModelTransformer | Cause all CodeSpecs to be exported from the source iModel and imported into the target iModel. |
processDeferredElements(_numRetries: number3): Promise<void> | IModelTransformer | Import elements that were deferred in a prior pass. |
processElement(sourceElementId: string): Promise<void> | IModelTransformer | Cause the specified Element and its child Elements (if applicable) to be exported from the source iModel and imported into the target iModel. |
processFonts(): Promise<void> | IModelTransformer | Cause all fonts to be exported from the source iModel and imported into the target iModel. |
processModel(sourceModeledElementId: string): Promise<void> | IModelTransformer | Cause the model container, contents, and sub-models to be exported from the source iModel and imported into the target iModel. |
processModelContents(sourceModelId: string, targetModelId: string, elementClassFullName: stringElement.classFullName): Promise<void> | IModelTransformer | Cause the model contents to be exported from the source iModel and imported into the target iModel. |
processRelationships(baseRelClassFullName: string): Promise<void> | IModelTransformer | Imports all relationships that subclass from the specified base class. |
processSchemas(): Promise<void> | IModelTransformer | Cause all schemas to be exported from the source iModel and imported into the target iModel. |
processSubject(sourceSubjectId: string, targetSubjectId: string): Promise<void> | IModelTransformer | Recursively import all Elements and sub-Models that descend from the specified Subject |
shouldDetectDeletes(): boolean Protected | IModelTransformer | Returns true if brute force delete detections should be run. |
shouldExportCodeSpec(_sourceCodeSpec: CodeSpec): boolean | IModelTransformer | Override of IModelExportHandler.shouldExportCodeSpec that is called to determine if a CodeSpec should be exported from the source iModel. |
shouldExportElement(_sourceElement: Element): boolean | IModelTransformer | Override of IModelExportHandler.shouldExportElement that is called to determine if an element should be exported from the source iModel. |
shouldExportElementAspect(aspect: ElementAspect): boolean | IModelTransformer | If true is returned, then the ElementAspect will be exported. |
shouldExportRelationship(_sourceRelationship: Relationship): boolean | IModelTransformer | Override of IModelExportHandler.shouldExportRelationship that is called to determine if a Relationship should be exported. |
shouldExportSchema(schemaKey: SchemaKey): boolean | IModelTransformer | Override of IModelExportHandler.shouldExportSchema that is called to determine if a schema should be exported |
skipElement(_sourceElement: Element): void Protected | IModelTransformer | |
tryGetProvenanceScopeAspect(): undefined | ExternalSourceAspect Protected | IModelTransformer | |
updateSynchronizationVersion(__namedParameters: { force: undefined | boolean }{}): void | IModelTransformer | called at the end of a transformation, |
determineSyncType(sourceDb: IModelDb, targetDb: IModelDb, targetScopeElementId: string): "reverse" | "forward" Static | IModelTransformer | Determines the sync direction "forward" or "reverse" of a given sourceDb and targetDb by looking for the scoping ESA. |
forEachTrackedElement(args: { fn: (sourceElementId: string, targetElementId: string) => void, isReverseSynchronization: boolean, provenanceDb: IModelDb, provenanceSourceDb: IModelDb, skipPropagateChangesToRootElements: boolean, targetScopeElementId: string }): void Static | IModelTransformer | Iterate all matching federation guids and ExternalSourceAspects in the provenance iModel (target unless reverse sync) |
initElementProvenanceOptions(sourceElementId: string, targetElementId: string, args: { isReverseSynchronization: boolean, sourceDb: IModelDb, targetDb: IModelDb, targetScopeElementId: string }): ExternalSourceAspectProps Static | IModelTransformer | Create an ExternalSourceAspectProps in a standard way for an Element in an iModel --> iModel transformation. |
initRelationshipProvenanceOptions(sourceRelInstanceId: string, targetRelInstanceId: string, args: { forceOldRelationshipProvenanceMethod: boolean, isReverseSynchronization: boolean, sourceDb: IModelDb, targetDb: IModelDb, targetScopeElementId: string }): ExternalSourceAspectProps Static | IModelTransformer | |
queryScopeExternalSourceAspect(dbToQuery: IModelDb, aspectProps: ExternalSourceAspectProps): undefined | { aspectId: string, jsonProperties?: string, version?: string } Static | IModelTransformer | Queries for an esa which matches the props in the provided aspectProps. |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
_elementsWithExplicitlyTrackedProvenance Protected | Set<string> | IModelTransformer | a set of elements for which source provenance will be explicitly tracked by ExternalSourceAspects |
_partiallyCommittedEntities Protected | <PartiallyCommittedEntity> | IModelTransformer | map of partially committed entities to their partial commit progress |
_pendingReferences Protected | PendingReferenceMap<PartiallyCommittedEntity> | IModelTransformer | map of (unprocessed element, referencing processed element) pairs to the partially committed element that needs the reference resolved |
_schemaExportDir Protected | string | IModelTransformer | The directory where schemas will be exported, a random temporary directory |
_skippedEntities Protected | Set< | | | > | IModelTransformer | Set of entity keys which were not exported and don't need to be tracked for pending reference resolution. |
context Readonly | IModelCloneContext | IModelTransformer | The IModelTransformContext for this IModelTransformer. |
exporter Readonly | IModelExporter | IModelTransformer | The IModelExporter that will export from the source iModel. |
importer Readonly | IModelImporter | IModelTransformer | The IModelImporter that will import into the target iModel. |
isForwardSynchronization Accessor ReadOnly | boolean | IModelTransformer | |
isReverseSynchronization Accessor ReadOnly | boolean | IModelTransformer | |
string | IModelTransformer | ||
provenanceDb Accessor ReadOnly | IModelDb | IModelTransformer | Return the IModelDb where IModelTransformer will store its provenance. |
provenanceElementAspectClasses Accessor Static ReadOnly | [] | IModelTransformer | The element aspect classes that are considered to define provenance in the iModel |
provenanceElementClasses Accessor Static ReadOnly | [] | IModelTransformer | The element classes that are considered to define provenance in the iModel |
provenanceSourceDb Accessor ReadOnly | IModelDb | IModelTransformer | Return the IModelDb where IModelTransformer looks for entities referred to by stored provenance. |
sourceDb Readonly | IModelDb | IModelTransformer | The normally read-only source iModel. |
synchronizationVersion Accessor Protected ReadOnly | ChangesetIndexAndId | IModelTransformer | the changeset in the scoping element's source version found for this transformation @note: the version depends on whether this is a reverse synchronization or not, as it is stored separately for both synchronization directions. @note: empty string and -1 for changeset and index if it has never been transformed, or was transformed before federation guid update (pre 1.x). |
targetDb Readonly | IModelDb | IModelTransformer | The read/write target iModel. |
targetScopeElementId Accessor ReadOnly | string | IModelTransformer | 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: 13 May, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.