@itwin/imodel-transformer 2.0.0-dev.6 → 2.0.0-dev.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -27
- package/lib/cjs/Algo.js.map +1 -1
- package/lib/cjs/BigMap.d.ts.map +1 -1
- package/lib/cjs/BigMap.js.map +1 -1
- package/lib/cjs/BranchProvenanceInitializer.d.ts.map +1 -1
- package/lib/cjs/BranchProvenanceInitializer.js +34 -34
- package/lib/cjs/BranchProvenanceInitializer.js.map +1 -1
- package/lib/cjs/ChangedElementForest.d.ts +14 -0
- package/lib/cjs/ChangedElementForest.d.ts.map +1 -0
- package/lib/cjs/ChangedElementForest.js +86 -0
- package/lib/cjs/ChangedElementForest.js.map +1 -0
- package/lib/cjs/ChangesetScanner.d.ts +61 -0
- package/lib/cjs/ChangesetScanner.d.ts.map +1 -0
- package/lib/cjs/ChangesetScanner.js +104 -0
- package/lib/cjs/ChangesetScanner.js.map +1 -0
- package/lib/cjs/ECReferenceTypesCache.d.ts +0 -3
- package/lib/cjs/ECReferenceTypesCache.d.ts.map +1 -1
- package/lib/cjs/ECReferenceTypesCache.js +61 -104
- package/lib/cjs/ECReferenceTypesCache.js.map +1 -1
- package/lib/cjs/ECSqlReaderAsyncIterableIteratorAdapter.d.ts.map +1 -1
- package/lib/cjs/ECSqlReaderAsyncIterableIteratorAdapter.js.map +1 -1
- package/lib/cjs/ElementAspectCleanup.d.ts +16 -0
- package/lib/cjs/ElementAspectCleanup.d.ts.map +1 -0
- package/lib/cjs/ElementAspectCleanup.js +87 -0
- package/lib/cjs/ElementAspectCleanup.js.map +1 -0
- package/lib/cjs/ElementAspectExportCoordinator.d.ts +44 -0
- package/lib/cjs/ElementAspectExportCoordinator.d.ts.map +1 -0
- package/lib/cjs/ElementAspectExportCoordinator.js +148 -0
- package/lib/cjs/ElementAspectExportCoordinator.js.map +1 -0
- package/lib/cjs/ElementAspectExportProcessor.d.ts +44 -0
- package/lib/cjs/ElementAspectExportProcessor.d.ts.map +1 -0
- package/lib/cjs/ElementAspectExportProcessor.js +152 -0
- package/lib/cjs/ElementAspectExportProcessor.js.map +1 -0
- package/lib/cjs/ElementBulkDelete.d.ts +11 -0
- package/lib/cjs/ElementBulkDelete.d.ts.map +1 -0
- package/lib/cjs/ElementBulkDelete.js +55 -0
- package/lib/cjs/ElementBulkDelete.js.map +1 -0
- package/lib/cjs/EntityExistenceCache.d.ts +43 -0
- package/lib/cjs/EntityExistenceCache.d.ts.map +1 -0
- package/lib/cjs/EntityExistenceCache.js +91 -0
- package/lib/cjs/EntityExistenceCache.js.map +1 -0
- package/lib/cjs/EntityMap.d.ts.map +1 -1
- package/lib/cjs/EntityMap.js.map +1 -1
- package/lib/cjs/EntityUnifier.d.ts +8 -8
- package/lib/cjs/EntityUnifier.d.ts.map +1 -1
- package/lib/cjs/EntityUnifier.js +56 -32
- package/lib/cjs/EntityUnifier.js.map +1 -1
- package/lib/cjs/IModelCloneContext.d.ts +9 -3
- package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelCloneContext.js +66 -31
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelExporter.d.ts +143 -30
- package/lib/cjs/IModelExporter.d.ts.map +1 -1
- package/lib/cjs/IModelExporter.js +893 -178
- package/lib/cjs/IModelExporter.js.map +1 -1
- package/lib/cjs/IModelImporter.d.ts +71 -30
- package/lib/cjs/IModelImporter.d.ts.map +1 -1
- package/lib/cjs/IModelImporter.js +269 -132
- package/lib/cjs/IModelImporter.js.map +1 -1
- package/lib/cjs/IModelTransformContext.d.ts +54 -0
- package/lib/cjs/IModelTransformContext.d.ts.map +1 -0
- package/lib/cjs/IModelTransformContext.js +3 -0
- package/lib/cjs/IModelTransformContext.js.map +1 -0
- package/lib/cjs/IModelTransformer.d.ts +130 -196
- package/lib/cjs/IModelTransformer.d.ts.map +1 -1
- package/lib/cjs/IModelTransformer.js +697 -1155
- package/lib/cjs/IModelTransformer.js.map +1 -1
- package/lib/cjs/IModelTransformerError.d.ts +84 -0
- package/lib/cjs/IModelTransformerError.d.ts.map +1 -0
- package/lib/cjs/IModelTransformerError.js +93 -0
- package/lib/cjs/IModelTransformerError.js.map +1 -0
- package/lib/cjs/ProvenanceManager.d.ts +177 -0
- package/lib/cjs/ProvenanceManager.d.ts.map +1 -0
- package/lib/cjs/ProvenanceManager.js +719 -0
- package/lib/cjs/ProvenanceManager.js.map +1 -0
- package/lib/cjs/SyncTypeResolver.d.ts +34 -0
- package/lib/cjs/SyncTypeResolver.d.ts.map +1 -0
- package/lib/cjs/SyncTypeResolver.js +98 -0
- package/lib/cjs/SyncTypeResolver.js.map +1 -0
- package/lib/cjs/TransformerLoggerCategory.d.ts +1 -1
- package/lib/cjs/TransformerLoggerCategory.js +1 -1
- package/lib/cjs/TransformerLoggerCategory.js.map +1 -1
- package/lib/cjs/TransformerPackageMetadata.d.ts +8 -0
- package/lib/cjs/TransformerPackageMetadata.d.ts.map +1 -0
- package/lib/cjs/TransformerPackageMetadata.js +47 -0
- package/lib/cjs/TransformerPackageMetadata.js.map +1 -0
- package/lib/cjs/imodel-transformer.d.ts +27 -0
- package/lib/cjs/imodel-transformer.d.ts.map +1 -1
- package/lib/cjs/imodel-transformer.js +61 -34
- package/lib/cjs/imodel-transformer.js.map +1 -1
- package/lib/cjs/schema-processing/DynamicSchemaUnionStrategy.d.ts +29 -0
- package/lib/cjs/schema-processing/DynamicSchemaUnionStrategy.d.ts.map +1 -0
- package/lib/cjs/schema-processing/DynamicSchemaUnionStrategy.js +212 -0
- package/lib/cjs/schema-processing/DynamicSchemaUnionStrategy.js.map +1 -0
- package/lib/cjs/schema-processing/SchemaProcessingCoordinator.d.ts +25 -0
- package/lib/cjs/schema-processing/SchemaProcessingCoordinator.d.ts.map +1 -0
- package/lib/cjs/schema-processing/SchemaProcessingCoordinator.js +196 -0
- package/lib/cjs/schema-processing/SchemaProcessingCoordinator.js.map +1 -0
- package/lib/cjs/schema-processing/SchemaProcessingStrategy.d.ts +59 -0
- package/lib/cjs/schema-processing/SchemaProcessingStrategy.d.ts.map +1 -0
- package/lib/cjs/schema-processing/SchemaProcessingStrategy.js +28 -0
- package/lib/cjs/schema-processing/SchemaProcessingStrategy.js.map +1 -0
- package/lib/cjs/schema-processing.d.ts +7 -0
- package/lib/cjs/schema-processing.d.ts.map +1 -0
- package/lib/cjs/schema-processing.js +27 -0
- package/lib/cjs/schema-processing.js.map +1 -0
- package/package.json +65 -43
- package/lib/cjs/DetachedExportElementAspectsStrategy.d.ts +0 -16
- package/lib/cjs/DetachedExportElementAspectsStrategy.d.ts.map +0 -1
- package/lib/cjs/DetachedExportElementAspectsStrategy.js +0 -106
- package/lib/cjs/DetachedExportElementAspectsStrategy.js.map +0 -1
- package/lib/cjs/ElementCascadingDeleter.d.ts +0 -22
- package/lib/cjs/ElementCascadingDeleter.d.ts.map +0 -1
- package/lib/cjs/ElementCascadingDeleter.js +0 -57
- package/lib/cjs/ElementCascadingDeleter.js.map +0 -1
- package/lib/cjs/ExportElementAspectsStrategy.d.ts +0 -35
- package/lib/cjs/ExportElementAspectsStrategy.d.ts.map +0 -1
- package/lib/cjs/ExportElementAspectsStrategy.js +0 -52
- package/lib/cjs/ExportElementAspectsStrategy.js.map +0 -1
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.d.ts +0 -12
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.d.ts.map +0 -1
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.js +0 -47
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelCloneContext.js","sourceRoot":"","sources":["../../src/IModelCloneContext.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,iCAAiC;AACjC,sDAAyE;AACzE,oDAa4B;AAC5B,sDAO6B;AAC7B,mEAAgE;AAChE,mDAAgD;AAChD,2EAAwE;AA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,wBAAwB,CAAC;IAClC,CAAC;CACF;AAnQD,gDAmQC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\nimport * as assert from \"assert\";\nimport { DbResult, Id64, Id64String, Logger } from \"@itwin/core-bentley\";\nimport {\n Code,\n CodeScopeSpec,\n ConcreteEntityTypes,\n ECJsNames,\n ElementAspectProps,\n ElementProps,\n EntityReference,\n IModel,\n IModelError,\n QueryBinder,\n RelatedElement,\n RelatedElementProps,\n} from \"@itwin/core-common\";\nimport {\n // eslint-disable-next-line @typescript-eslint/no-redeclare\n Element,\n ElementAspect,\n EntityReferences,\n IModelElementCloneContext,\n IModelJsNative,\n} from \"@itwin/core-backend\";\nimport { ECReferenceTypesCache } from \"./ECReferenceTypesCache\";\nimport { EntityUnifier } from \"./EntityUnifier\";\nimport { TransformerLoggerCategory } from \"./TransformerLoggerCategory\";\nimport { parseClassModifier, Property } from \"@itwin/ecschema-metadata\";\n\nconst loggerCategory: string = TransformerLoggerCategory.IModelCloneContext;\n\n/** The context for transforming a *source* Element to a *target* Element and remapping internal identifiers to the target iModel.\n * @beta\n */\nexport class IModelCloneContext extends IModelElementCloneContext {\n private _refTypesCache = new ECReferenceTypesCache();\n private _aspectRemapTable = new Map<Id64String, Id64String>();\n\n /** perform necessary initialization to use a clone context, namely caching the reference types in the source's schemas */\n public override async initialize() {\n await this._refTypesCache.initAllSchemasInIModel(this.sourceDb);\n }\n\n /** Clone the specified source Element into ElementProps for the target iModel.\n * @internal\n */\n public override cloneElement(\n sourceElement: Element,\n cloneOptions?: IModelJsNative.CloneElementOptions\n ): ElementProps {\n const targetElementProps: ElementProps = this[\n \"_nativeContext\"\n ].cloneElement(sourceElement.id, cloneOptions);\n // Ensure that all NavigationProperties in targetElementProps have a defined value so \"clearing\" changes will be part of the JSON used for update\n sourceElement.forEach((name: string, property: Property) => {\n if (\n property.isNavigation() &&\n undefined === (sourceElement as any)[ECJsNames.toJsName(name)]\n ) {\n (targetElementProps as any)[ECJsNames.toJsName(name)] =\n RelatedElement.none;\n }\n }, false); // exclude custom because C++ has already handled them\n if (this.isBetweenIModels) {\n // The native C++ cloneElement strips off federationGuid, want to put it back if transformation is between iModels\n targetElementProps.federationGuid = sourceElement.federationGuid;\n const targetElementCodeScopeType = this.targetDb.codeSpecs.getById(\n targetElementProps.code.spec\n ).scopeType;\n if (\n CodeScopeSpec.Type.Repository === targetElementCodeScopeType &&\n targetElementProps.code.scope !== IModel.rootSubjectId\n ) {\n Logger.logWarning(\n loggerCategory,\n `Incorrect CodeScope '${targetElementCodeScopeType}' is set for target element ${targetElementProps.id}`\n );\n }\n }\n // unlike other references, code cannot be null. If it is null, use an empty code instead\n // this will be updated back later as the transformer resolves references\n if (\n targetElementProps.code.scope === Id64.invalid ||\n targetElementProps.code.spec === Id64.invalid\n ) {\n targetElementProps.code = Code.createEmpty();\n }\n const jsClass = this.sourceDb.getJsClass<typeof Element>(\n sourceElement.classFullName\n );\n jsClass[\"onCloned\"](this, sourceElement.toJSON(), targetElementProps);\n return targetElementProps;\n }\n\n /** Add a rule that remaps the specified source ElementAspect to the specified target ElementAspect. */\n public remapElementAspect(\n aspectSourceId: Id64String,\n aspectTargetId: Id64String\n ): void {\n this._aspectRemapTable.set(aspectSourceId, aspectTargetId);\n }\n\n /** Remove a rule that remaps the specified source ElementAspect */\n public removeElementAspect(aspectSourceId: Id64String): void {\n this._aspectRemapTable.delete(aspectSourceId);\n }\n\n /** Look up a target AspectId from the source AspectId.\n * @returns the target AspectId or [Id64.invalid]($bentley) if a mapping not found.\n */\n public findTargetAspectId(sourceAspectId: Id64String): Id64String {\n return this._aspectRemapTable.get(sourceAspectId) ?? Id64.invalid;\n }\n\n /** Look up a target [EntityReference]($bentley) from a source [EntityReference]($bentley)\n * @returns the target CodeSpecId or a [EntityReference]($bentley) containing [Id64.invalid]($bentley) if a mapping is not found.\n */\n public async findTargetEntityId(\n sourceEntityId: EntityReference\n ): Promise<EntityReference> {\n const [type, rawId] = EntityReferences.split(sourceEntityId);\n if (Id64.isValid(rawId)) {\n switch (type) {\n case ConcreteEntityTypes.Model: {\n let targetId;\n /**\n * The repository model is a singleton container which exists in all iModels which has a modelId of 0x1.\n * It is possible to remap the root subject (id 0x1) to some other non root subject, but this is not possible for the repository model.\n * The RepositoryModel only contains bis:Subject elements and bis:InformationpartitionElement instances (https://www.itwinjs.org/bis/domains/biscore.ecschema/#repositorymodel)\n * The system handler for both bis:InformationPartitionElement and bis:Subject will only permit instances to be inserted into the RepositoryModel.\n * https://www.itwinjs.org/bis/domains/biscore.ecschema/#informationpartitionelement\n * https://www.itwinjs.org/bis/domains/biscore.ecschema/#subject\n * Since there is a chance that the root subject is remapped to some other subject which has the same id as the repositoryModel, we need to ignore the remapping for the repository model.\n */\n if (rawId === IModel.repositoryModelId) {\n targetId = `m${IModel.repositoryModelId}` as const;\n } else {\n targetId = `m${this.findTargetElementId(rawId)}` as const;\n }\n // Check if the model exists, `findTargetElementId` may have worked because the element exists when the model doesn't.\n // That can occur in the transformer since a submodeled element is imported before its submodel.\n if (\n EntityUnifier.exists(this.targetDb, { entityReference: targetId })\n )\n return targetId;\n break;\n }\n case ConcreteEntityTypes.Element:\n return `e${this.findTargetElementId(rawId)}`;\n case ConcreteEntityTypes.ElementAspect:\n return `a${this.findTargetAspectId(rawId)}`;\n case ConcreteEntityTypes.Relationship: {\n const makeGetConcreteEntityTypeSql = (property: string) => `\n CASE\n WHEN [${property}] IS (BisCore.ElementUniqueAspect) OR [${property}] IS (BisCore.ElementMultiAspect)\n THEN 'a'\n WHEN [${property}] IS (BisCore.Element)\n THEN 'e'\n WHEN [${property}] IS (BisCore.Model)\n THEN 'm'\n WHEN [${property}] IS (BisCore.CodeSpec)\n THEN 'c'\n WHEN [${property}] IS (BisCore.ElementRefersToElements) -- TODO: ElementDrivesElement still not handled by the transformer\n THEN 'r'\n ELSE 'error'\n END\n `;\n const sql = `\n SELECT\n SourceECInstanceId,\n TargetECInstanceId,\n (${makeGetConcreteEntityTypeSql(\n \"SourceECClassId\"\n )}) AS SourceType,\n (${makeGetConcreteEntityTypeSql(\"TargetECClassId\")}) AS TargetType\n FROM BisCore:ElementRefersToElements\n WHERE ECInstanceId=?\n `;\n const params = new QueryBinder().bindId(1, rawId);\n const reader = this.sourceDb.createQueryReader(sql, params);\n const relInSource = await (async () => {\n if (await reader.step()) {\n const sourceId = reader.current[0];\n const targetId = reader.current[1];\n const sourceType = reader.current[2] as\n | ConcreteEntityTypes\n | \"error\";\n const targetType = reader.current[3] as\n | ConcreteEntityTypes\n | \"error\";\n if (sourceType === \"error\" || targetType === \"error\")\n throw Error(\"relationship end had unknown root class\");\n return {\n sourceId: `${sourceType}${sourceId}`,\n targetId: `${targetType}${targetId}`,\n } as const;\n }\n return undefined;\n })();\n if (relInSource === undefined) break;\n // just in case prevent recursion\n if (\n relInSource.sourceId === sourceEntityId ||\n relInSource.targetId === sourceEntityId\n )\n throw Error(\n \"link table relationship end was resolved to itself. This should be impossible\"\n );\n const relInTarget = {\n sourceId: await this.findTargetEntityId(relInSource.sourceId),\n targetId: await this.findTargetEntityId(relInSource.targetId),\n };\n // return a null\n if (\n !EntityReferences.isValid(relInTarget.sourceId) ||\n !EntityReferences.isValid(relInTarget.targetId)\n )\n break;\n // eslint-disable-next-line @itwin/no-internal, @typescript-eslint/no-deprecated\n const relInTargetId = this.targetDb.withPreparedStatement(\n `\n SELECT ECInstanceId\n FROM BisCore:ElementRefersToElements\n WHERE SourceECInstanceId=?\n AND TargetECInstanceId=?\n `,\n (stmt) => {\n stmt.bindId(1, EntityReferences.toId64(relInTarget.sourceId));\n stmt.bindId(2, EntityReferences.toId64(relInTarget.targetId));\n const status: DbResult = stmt.step();\n if (status === DbResult.BE_SQLITE_ROW)\n return stmt.getValue(0).getId();\n if (status !== DbResult.BE_SQLITE_DONE)\n throw new IModelError(status, \"unexpected query failure\");\n return Id64.invalid;\n }\n );\n return `r${relInTargetId}`;\n }\n }\n }\n return `${type}${Id64.invalid}`;\n }\n\n /** Clone the specified source Element into ElementProps for the target iModel.\n * @internal\n */\n public async cloneElementAspect(\n sourceElementAspect: ElementAspect\n ): Promise<ElementAspectProps> {\n const targetElementAspectProps: ElementAspectProps =\n sourceElementAspect.toJSON();\n targetElementAspectProps.id = undefined;\n const targetEntityIds: Promise<void>[] = [];\n sourceElementAspect.forEach((name, property) => {\n if (property.isNavigation()) {\n const sourceNavProp: RelatedElementProps | undefined =\n sourceElementAspect.asAny[ECJsNames.toJsName(name)];\n if (sourceNavProp?.id) {\n const navPropRefType = this._refTypesCache.getNavPropRefType(\n sourceElementAspect.schemaName,\n sourceElementAspect.className,\n ECJsNames.toJsName(name)\n );\n assert(\n navPropRefType !== undefined,\n `nav prop ref type for '${name}' was not in the cache, this is a bug.`\n );\n targetEntityIds.push(\n this.findTargetEntityId(\n EntityReferences.fromEntityType(sourceNavProp.id, navPropRefType)\n ).then((targetEntityReference) => {\n const targetEntityId = EntityReferences.toId64(\n targetEntityReference\n );\n // spread the property in case toJSON did not deep-clone\n (targetElementAspectProps as any)[ECJsNames.toJsName(name)] = {\n ...(targetElementAspectProps as any)[ECJsNames.toJsName(name)],\n id: targetEntityId,\n };\n })\n );\n }\n } else if (property.isPrimitive() && \"Id\" === property.extendedTypeName) {\n (targetElementAspectProps as any)[ECJsNames.toJsName(name)] =\n this.findTargetElementId(\n sourceElementAspect.asAny[ECJsNames.toJsName(name)]\n );\n }\n });\n await Promise.all(targetEntityIds);\n return targetElementAspectProps;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IModelCloneContext.js","sourceRoot":"","sources":["../../src/IModelCloneContext.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,6CAA+C;AAC/C,sDAA+D;AAC/D,oDAY4B;AAC5B,sDAO6B;AAC7B,gEAAuD;AACvD,mEAAgE;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AAI,QAAQ,CAAC,WAAW,EAAE,IAAI,IAAI,KAAK,QAAQ,CAAC,gBAAgB,EAAE,CAAC;gBACvE,wBAAgC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAChE,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAChC,CAAC;YACJ,CAAC;QACH,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACnC,OAAO,wBAAwB,CAAC;IAClC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\nimport { strict as assert } from \"node:assert\";\nimport { Id64, Id64String, Logger } from \"@itwin/core-bentley\";\nimport {\n Code,\n CodeScopeSpec,\n ConcreteEntityTypes,\n ECJsNames,\n ElementAspectProps,\n ElementProps,\n EntityReference,\n IModel,\n QueryBinder,\n RelatedElement,\n RelatedElementProps,\n} from \"@itwin/core-common\";\nimport {\n // eslint-disable-next-line @typescript-eslint/no-redeclare\n Element,\n ElementAspect,\n EntityReferences,\n IModelElementCloneContext,\n IModelJsNative,\n} from \"@itwin/core-backend\";\nimport { EntityClass } from \"@itwin/ecschema-metadata\";\nimport { ECReferenceTypesCache } from \"./ECReferenceTypesCache\";\nimport { EntityExistenceCache } from \"./EntityExistenceCache\";\nimport { TransformerLoggerCategory } from \"./TransformerLoggerCategory\";\nimport { BigMap } from \"./BigMap\";\nimport type { IModelTransformContext } from \"./IModelTransformContext\";\n\nconst loggerCategory: string = TransformerLoggerCategory.IModelCloneContext;\n\n/** The context for transforming a *source* Element to a *target* Element and remapping internal identifiers to the target iModel.\n * @internal\n */\nexport class IModelCloneContext\n extends IModelElementCloneContext\n implements IModelTransformContext\n{\n private _refTypesCache = new ECReferenceTypesCache();\n private _aspectRemapTable = new BigMap<Id64String>();\n\n /** A positive-only cache of entity existence checks, scoped to the current transformation run.\n * @internal\n */\n public readonly existenceCache = new EntityExistenceCache();\n\n /** perform necessary initialization to use a clone context, namely caching the reference types in the source's schemas */\n public override async initialize() {\n await this._refTypesCache.initAllSchemasInIModel(this.sourceDb);\n }\n\n /** Clone the specified source Element into ElementProps for the target iModel.\n * @internal\n */\n public override async cloneElement(\n sourceElement: Element,\n cloneOptions?: IModelJsNative.CloneElementOptions\n ): Promise<ElementProps> {\n const targetElementProps: ElementProps = this[\n \"_nativeContext\"\n ].cloneElement(sourceElement.id, cloneOptions);\n // Native same-iModel cloning clears codes for inserts, but identity mappings are updates.\n if (\n !this.isBetweenIModels &&\n this.findTargetElementId(sourceElement.id) === sourceElement.id\n ) {\n targetElementProps.code.value = sourceElement.code.value;\n if (!Id64.isValidId64(targetElementProps.code.spec)) {\n const mappedCodeSpecId = this.findTargetCodeSpecId(\n sourceElement.code.spec\n );\n targetElementProps.code.spec = Id64.isValidId64(mappedCodeSpecId)\n ? mappedCodeSpecId\n : sourceElement.code.spec;\n }\n if (!Id64.isValidId64(targetElementProps.code.scope)) {\n const mappedCodeScopeId = this.findTargetElementId(\n sourceElement.code.scope\n );\n targetElementProps.code.scope = Id64.isValidId64(mappedCodeScopeId)\n ? mappedCodeScopeId\n : sourceElement.code.scope;\n }\n }\n // Ensure that all NavigationProperties in targetElementProps have a defined value so \"clearing\" changes will be part of the JSON used for update\n const sourceElementClass =\n sourceElement.iModel.schemaContext.getSchemaItemSync(\n sourceElement.schemaItemKey,\n EntityClass\n );\n assert(\n sourceElementClass !== undefined,\n `Cannot get metadata for ${sourceElement.classFullName}.`\n );\n for (const property of sourceElementClass.getPropertiesSync()) {\n // Exclude custom properties because C++ has already handled them.\n if (property.customAttributes?.has(\"BisCore.CustomHandledProperty\"))\n continue;\n\n const name = property.name;\n if (\n property.isNavigation() &&\n undefined === (sourceElement as any)[ECJsNames.toJsName(name)]\n ) {\n (targetElementProps as any)[ECJsNames.toJsName(name)] =\n RelatedElement.none;\n }\n }\n if (this.isBetweenIModels) {\n // The native C++ cloneElement strips off federationGuid, want to put it back if transformation is between iModels\n targetElementProps.federationGuid = sourceElement.federationGuid;\n const targetElementCodeScopeType = this.targetDb.codeSpecs.getById(\n targetElementProps.code.spec\n ).scopeType;\n if (\n CodeScopeSpec.Type.Repository === targetElementCodeScopeType &&\n targetElementProps.code.scope !== IModel.rootSubjectId\n ) {\n Logger.logWarning(\n loggerCategory,\n `Incorrect CodeScope '${targetElementCodeScopeType}' is set for target element ${targetElementProps.id}`\n );\n }\n }\n // unlike other references, code cannot be null. If it is null, use an empty code instead\n // this will be updated back later as the transformer resolves references\n if (\n targetElementProps.code.scope === Id64.invalid ||\n targetElementProps.code.spec === Id64.invalid\n ) {\n targetElementProps.code = Code.createEmpty();\n }\n const jsClass = this.sourceDb.getJsClass<typeof Element>(\n sourceElement.classFullName\n );\n await jsClass[\"onCloned\"](this, sourceElement.toJSON(), targetElementProps);\n return targetElementProps;\n }\n\n /** Add a rule that remaps the specified source ElementAspect to the specified target ElementAspect. */\n public remapElementAspect(\n aspectSourceId: Id64String,\n aspectTargetId: Id64String\n ): void {\n this._aspectRemapTable.set(aspectSourceId, aspectTargetId);\n }\n\n /** Remove a rule that remaps the specified source ElementAspect */\n public removeElementAspect(aspectSourceId: Id64String): void {\n this._aspectRemapTable.delete(aspectSourceId);\n }\n\n /** Look up a target AspectId from the source AspectId.\n * @returns the target AspectId or [Id64.invalid]($bentley) if a mapping not found.\n */\n public findTargetAspectId(sourceAspectId: Id64String): Id64String {\n return this._aspectRemapTable.get(sourceAspectId) ?? Id64.invalid;\n }\n\n /** Look up a target [EntityReference]($bentley) from a source [EntityReference]($bentley)\n * @returns the target CodeSpecId or a [EntityReference]($bentley) containing [Id64.invalid]($bentley) if a mapping is not found.\n */\n public async findTargetEntityId(\n sourceEntityId: EntityReference\n ): Promise<EntityReference> {\n const [type, rawId] = EntityReferences.split(sourceEntityId);\n if (Id64.isValid(rawId)) {\n switch (type) {\n case ConcreteEntityTypes.Model: {\n let targetId;\n /**\n * The repository model is a singleton container which exists in all iModels which has a modelId of 0x1.\n * It is possible to remap the root subject (id 0x1) to some other non root subject, but this is not possible for the repository model.\n * The RepositoryModel only contains bis:Subject elements and bis:InformationpartitionElement instances (https://www.itwinjs.org/bis/domains/biscore.ecschema/#repositorymodel)\n * The system handler for both bis:InformationPartitionElement and bis:Subject will only permit instances to be inserted into the RepositoryModel.\n * https://www.itwinjs.org/bis/domains/biscore.ecschema/#informationpartitionelement\n * https://www.itwinjs.org/bis/domains/biscore.ecschema/#subject\n * Since there is a chance that the root subject is remapped to some other subject which has the same id as the repositoryModel, we need to ignore the remapping for the repository model.\n */\n if (rawId === IModel.repositoryModelId) {\n targetId = `m${IModel.repositoryModelId}` as const;\n } else {\n targetId = `m${this.findTargetElementId(rawId)}` as const;\n }\n // Check if the model exists, `findTargetElementId` may have worked because the element exists when the model doesn't.\n // That can occur in the transformer since a submodeled element is imported before its submodel.\n if (await this.existenceCache.exists(this.targetDb, targetId))\n return targetId;\n break;\n }\n case ConcreteEntityTypes.Element:\n return `e${this.findTargetElementId(rawId)}`;\n case ConcreteEntityTypes.ElementAspect:\n return `a${this.findTargetAspectId(rawId)}`;\n case ConcreteEntityTypes.Relationship: {\n const makeGetConcreteEntityTypeSql = (property: string) => `\n CASE\n WHEN [${property}] IS (BisCore.ElementUniqueAspect) OR [${property}] IS (BisCore.ElementMultiAspect)\n THEN 'a'\n WHEN [${property}] IS (BisCore.Element)\n THEN 'e'\n WHEN [${property}] IS (BisCore.Model)\n THEN 'm'\n WHEN [${property}] IS (BisCore.CodeSpec)\n THEN 'c'\n WHEN [${property}] IS (BisCore.ElementRefersToElements) -- TODO: ElementDrivesElement still not handled by the transformer\n THEN 'r'\n ELSE 'error'\n END\n `;\n const sql = `\n SELECT\n SourceECInstanceId,\n TargetECInstanceId,\n (${makeGetConcreteEntityTypeSql(\n \"SourceECClassId\"\n )}) AS SourceType,\n (${makeGetConcreteEntityTypeSql(\"TargetECClassId\")}) AS TargetType\n FROM BisCore:ElementRefersToElements\n WHERE ECInstanceId=?\n `;\n const params = new QueryBinder().bindId(1, rawId);\n const reader = this.sourceDb.createQueryReader(sql, params, {\n usePrimaryConn: true,\n });\n const relInSource = await (async () => {\n if (await reader.step()) {\n const sourceId = reader.current[0];\n const targetId = reader.current[1];\n const sourceType = reader.current[2] as\n | ConcreteEntityTypes\n | \"error\";\n const targetType = reader.current[3] as\n | ConcreteEntityTypes\n | \"error\";\n if (sourceType === \"error\" || targetType === \"error\")\n throw Error(\"relationship end had unknown root class\");\n return {\n sourceId: `${sourceType}${sourceId}`,\n targetId: `${targetType}${targetId}`,\n } as const;\n }\n return undefined;\n })();\n if (relInSource === undefined) break;\n // just in case prevent recursion\n if (\n relInSource.sourceId === sourceEntityId ||\n relInSource.targetId === sourceEntityId\n )\n throw Error(\n \"link table relationship end was resolved to itself. This should be impossible\"\n );\n const relInTarget = {\n sourceId: await this.findTargetEntityId(relInSource.sourceId),\n targetId: await this.findTargetEntityId(relInSource.targetId),\n };\n // return a null\n if (\n !EntityReferences.isValid(relInTarget.sourceId) ||\n !EntityReferences.isValid(relInTarget.targetId)\n )\n break;\n const relInTargetSql = `\n SELECT ECInstanceId\n FROM BisCore:ElementRefersToElements\n WHERE SourceECInstanceId=?\n AND TargetECInstanceId=?\n `;\n const relInTargetParams = new QueryBinder();\n relInTargetParams.bindId(\n 1,\n EntityReferences.toId64(relInTarget.sourceId)\n );\n relInTargetParams.bindId(\n 2,\n EntityReferences.toId64(relInTarget.targetId)\n );\n const relInTargetResult = await this.targetDb\n .createQueryReader(relInTargetSql, relInTargetParams, {\n usePrimaryConn: true,\n })\n .next();\n const relInTargetId = relInTargetResult.done\n ? Id64.invalid\n : relInTargetResult.value.id;\n return `r${relInTargetId}`;\n }\n }\n }\n return `${type}${Id64.invalid}`;\n }\n\n /** Clone the specified source Element into ElementProps for the target iModel.\n * @internal\n */\n public async cloneElementAspect(\n sourceElementAspect: ElementAspect\n ): Promise<ElementAspectProps> {\n const targetElementAspectProps: ElementAspectProps =\n sourceElementAspect.toJSON();\n targetElementAspectProps.id = undefined;\n const targetEntityIds: Promise<void>[] = [];\n const sourceElementAspectClass =\n sourceElementAspect.iModel.schemaContext.getSchemaItemSync(\n sourceElementAspect.schemaItemKey,\n EntityClass\n );\n assert(\n sourceElementAspectClass !== undefined,\n `Cannot get metadata for ${sourceElementAspect.classFullName}.`\n );\n for (const property of sourceElementAspectClass.getPropertiesSync()) {\n const ecName = property.name;\n const name = ECJsNames.toJsName(ecName);\n if (property.isNavigation()) {\n const sourceNavProp: RelatedElementProps | undefined =\n sourceElementAspect.asAny[name];\n if (sourceNavProp?.id) {\n const navPropRefType = this._refTypesCache.getNavPropRefType(\n sourceElementAspect.schemaName,\n sourceElementAspect.className,\n name\n );\n assert(\n navPropRefType !== undefined,\n `nav prop ref type for '${name}' was not in the cache, this is a bug.`\n );\n targetEntityIds.push(\n this.findTargetEntityId(\n EntityReferences.fromEntityType(sourceNavProp.id, navPropRefType)\n ).then((targetEntityReference) => {\n const targetEntityId = EntityReferences.toId64(\n targetEntityReference\n );\n // spread the property in case toJSON did not deep-clone\n (targetElementAspectProps as any)[name] = {\n ...(targetElementAspectProps as any)[name],\n id: targetEntityId,\n };\n })\n );\n }\n } else if (property.isPrimitive() && \"Id\" === property.extendedTypeName) {\n (targetElementAspectProps as any)[name] = this.findTargetElementId(\n sourceElementAspect.asAny[name]\n );\n }\n }\n await Promise.all(targetEntityIds);\n return targetElementAspectProps;\n }\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module iModels
|
|
3
3
|
*/
|
|
4
|
-
import { BriefcaseDb,
|
|
5
|
-
import { Id64Arg, Id64String } from "@itwin/core-bentley";
|
|
4
|
+
import { BriefcaseDb, ChangeInstance, Element, ElementAspect, ElementMultiAspect, ElementUniqueAspect, IModelDb, IModelJsNative, Model, Relationship, SqliteChangeOp } from "@itwin/core-backend";
|
|
5
|
+
import { GuidString, Id64Arg, Id64String } from "@itwin/core-bentley";
|
|
6
6
|
import { ChangesetFileProps, CodeSpec, FontFamilyDescriptor, FontProps } from "@itwin/core-common";
|
|
7
7
|
import { Schema, SchemaKey } from "@itwin/ecschema-metadata";
|
|
8
|
-
import {
|
|
8
|
+
import { ElementAspectExportCoordinator } from "./ElementAspectExportCoordinator";
|
|
9
9
|
/**
|
|
10
10
|
* @beta
|
|
11
11
|
* The (optional) result of [[IModelExportHandler.onExportSchema]]
|
|
@@ -70,35 +70,37 @@ export declare abstract class IModelExportHandler {
|
|
|
70
70
|
/** If `true` is returned, then the CodeSpec will be exported.
|
|
71
71
|
* @note This method can optionally be overridden to exclude an individual CodeSpec from the export. The base implementation always returns `true`.
|
|
72
72
|
*/
|
|
73
|
-
shouldExportCodeSpec(_codeSpec: CodeSpec): boolean
|
|
73
|
+
shouldExportCodeSpec(_codeSpec: CodeSpec): Promise<boolean>;
|
|
74
74
|
/** Called when a CodeSpec should be exported.
|
|
75
75
|
* @param codeSpec The CodeSpec to export
|
|
76
76
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
77
77
|
* @note This should be overridden to actually do the export.
|
|
78
78
|
*/
|
|
79
|
-
onExportCodeSpec(_codeSpec: CodeSpec, _isUpdate: boolean | undefined): void
|
|
79
|
+
onExportCodeSpec(_codeSpec: CodeSpec, _isUpdate: boolean | undefined): Promise<void>;
|
|
80
80
|
/** Called when a font should be exported.
|
|
81
81
|
* @param font The font to export
|
|
82
82
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
83
83
|
* @note This should be overridden to actually do the export.
|
|
84
84
|
*/
|
|
85
|
-
onExportFont(_font: FontProps, _isUpdate: boolean | undefined): void
|
|
85
|
+
onExportFont(_font: FontProps, _isUpdate: boolean | undefined): Promise<void>;
|
|
86
86
|
/** Called when a model should be exported.
|
|
87
87
|
* @param model The model to export
|
|
88
88
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
89
89
|
* @note This should be overridden to actually do the export.
|
|
90
90
|
*/
|
|
91
|
-
onExportModel(_model: Model, _isUpdate: boolean | undefined): void
|
|
91
|
+
onExportModel(_model: Model, _isUpdate: boolean | undefined): Promise<void>;
|
|
92
92
|
/** Called when a model should be deleted. */
|
|
93
93
|
onDeleteModel(_modelId: Id64String): Promise<void>;
|
|
94
94
|
/** If `true` is returned, then the element will be exported.
|
|
95
95
|
* @note This method can optionally be overridden to exclude an individual Element (and its children and ElementAspects) from the export. The base implementation always returns `true`.
|
|
96
|
+
* @note During [IModelExporter.exportChanges]($transformer), this method is also called once for each unchanged ancestor of a changed element, so that a rejected ancestor excludes its changed descendants.
|
|
96
97
|
*/
|
|
97
|
-
shouldExportElement(_element: Element): boolean
|
|
98
|
+
shouldExportElement(_element: Element): Promise<boolean>;
|
|
98
99
|
/** Called when element is skipped instead of exported.
|
|
99
100
|
* @note When an element is skipped, exporter will not export any of its child elements. Because of this, [[onSkipElement]] will not be invoked for any children of a "skipped" element.
|
|
101
|
+
* @note During [IModelExporter.exportChanges]($transformer), an unchanged ancestor is filtered only when a changed descendant is reached. An element excluded by ID below it may therefore receive [[onSkipElement]] before the ancestor is rejected.
|
|
100
102
|
*/
|
|
101
|
-
onSkipElement(_elementId: Id64String): void
|
|
103
|
+
onSkipElement(_elementId: Id64String): Promise<void>;
|
|
102
104
|
/** Called when an element should be exported.
|
|
103
105
|
* @param element The element to export
|
|
104
106
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
@@ -112,12 +114,12 @@ export declare abstract class IModelExportHandler {
|
|
|
112
114
|
* @internal
|
|
113
115
|
*/
|
|
114
116
|
preExportElement(_element: Element): Promise<void>;
|
|
115
|
-
/** Called
|
|
116
|
-
|
|
117
|
+
/** Called once with the source IDs of all elements deleted by the exported changes. */
|
|
118
|
+
onDeleteElements(_elementIds: ReadonlySet<Id64String>): Promise<void>;
|
|
117
119
|
/** If `true` is returned, then the ElementAspect will be exported.
|
|
118
120
|
* @note This method can optionally be overridden to exclude an individual ElementAspect from the export. The base implementation always returns `true`.
|
|
119
121
|
*/
|
|
120
|
-
shouldExportElementAspect(_aspect: ElementAspect): boolean
|
|
122
|
+
shouldExportElementAspect(_aspect: ElementAspect): Promise<boolean>;
|
|
121
123
|
/** Called when an ElementUniqueAspect should be exported.
|
|
122
124
|
* @param aspect The ElementUniqueAspect to export
|
|
123
125
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
@@ -131,19 +133,21 @@ export declare abstract class IModelExportHandler {
|
|
|
131
133
|
/** If `true` is returned, then the relationship will be exported.
|
|
132
134
|
* @note This method can optionally be overridden to exclude an individual CodeSpec from the export. The base implementation always returns `true`.
|
|
133
135
|
*/
|
|
134
|
-
shouldExportRelationship(_relationship: Relationship): boolean
|
|
136
|
+
shouldExportRelationship(_relationship: Relationship): Promise<boolean>;
|
|
135
137
|
/** Called when a Relationship should be exported.
|
|
136
138
|
* @param relationship The Relationship to export
|
|
137
139
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
140
|
+
* @param sourceFedGuid The FederationGuid of the relationship's source endpoint, if available.
|
|
141
|
+
* @param targetFedGuid The FederationGuid of the relationship's target endpoint, if available.
|
|
138
142
|
* @note This should be overridden to actually do the export.
|
|
139
143
|
*/
|
|
140
|
-
onExportRelationship(_relationship: Relationship, _isUpdate: boolean | undefined): Promise<void>;
|
|
144
|
+
onExportRelationship(_relationship: Relationship, _isUpdate: boolean | undefined, _sourceFedGuid?: GuidString, _targetFedGuid?: GuidString): Promise<void>;
|
|
141
145
|
/** Called when a relationship should be deleted. */
|
|
142
|
-
onDeleteRelationship(_relInstanceId: Id64String): void
|
|
146
|
+
onDeleteRelationship(_relInstanceId: Id64String): Promise<void>;
|
|
143
147
|
/** If `true` is returned, then the schema will be exported.
|
|
144
148
|
* @note This method can optionally be overridden to exclude an individual schema from the export. The base implementation always returns `true`.
|
|
145
149
|
*/
|
|
146
|
-
shouldExportSchema(_schemaKey: SchemaKey): boolean
|
|
150
|
+
shouldExportSchema(_schemaKey: SchemaKey): Promise<boolean>;
|
|
147
151
|
/** Called when a schema should be exported.
|
|
148
152
|
* @param schema The schema to export
|
|
149
153
|
* @note This should be overridden to actually do the export.
|
|
@@ -159,10 +163,14 @@ export declare abstract class IModelExportHandler {
|
|
|
159
163
|
}
|
|
160
164
|
/** Base class for exporting data from an iModel.
|
|
161
165
|
* @note Most uses cases will not require a custom subclass of `IModelExporter`. Instead, it is more typical to subclass/customize [IModelExportHandler]($transformer).
|
|
166
|
+
* ElementAspects are exported separately from element callbacks in bounded,
|
|
167
|
+
* owner-scoped groups. Aspect callbacks are not guaranteed to be adjacent to
|
|
168
|
+
* callbacks for their owners.
|
|
162
169
|
* @see [iModel Transformation and Data Exchange]($docs/learning/transformer/index.md), [[registerHandler]], [IModelTransformer]($transformer), [IModelImporter]($transformer)
|
|
163
170
|
* @beta
|
|
164
171
|
*/
|
|
165
172
|
export declare class IModelExporter {
|
|
173
|
+
private static readonly _elementAspectOwnerBatchSize;
|
|
166
174
|
/** The read-only source iModel. */
|
|
167
175
|
readonly sourceDb: IModelDb;
|
|
168
176
|
/** A flag that indicates whether element GeometryStreams are loaded or not.
|
|
@@ -196,6 +204,12 @@ export declare class IModelExporter {
|
|
|
196
204
|
private _progressCounter;
|
|
197
205
|
/** Optionally cached entity change information */
|
|
198
206
|
private _sourceDbChanges?;
|
|
207
|
+
/** State shared by nested calls in one change-processing element traversal. */
|
|
208
|
+
private _changedElementTraversal?;
|
|
209
|
+
/** Unchanged elements on the current change-processing path. Each is filtered only when a changed descendant is reached. */
|
|
210
|
+
private readonly _unchangedAncestors;
|
|
211
|
+
/** Bounds the additional hierarchy retained by the sparse changed-element path. */
|
|
212
|
+
private readonly _changedElementForestElementLimit;
|
|
199
213
|
/**
|
|
200
214
|
* Retrieve the cached entity change information.
|
|
201
215
|
* @note This will only be initialized after [IModelExporter.exportChanges] is invoked or [IModelExporter.initialize] is called.
|
|
@@ -215,13 +229,22 @@ export declare class IModelExporter {
|
|
|
215
229
|
private _excludedElementClasses;
|
|
216
230
|
/** The set of classes of Relationships that will be excluded (polymorphically) from transformation to the target iModel. */
|
|
217
231
|
private _excludedRelationshipClasses;
|
|
218
|
-
/**
|
|
219
|
-
private
|
|
232
|
+
/** Exports ElementAspects for accepted owner groups. */
|
|
233
|
+
private _elementAspectExportProcessor;
|
|
234
|
+
/** Coordinates accepted-owner scopes and bounded group processing. */
|
|
235
|
+
private readonly _elementAspectExportCoordinator;
|
|
236
|
+
/** Coordinates accepted ElementAspect owners and bounded group processing.
|
|
237
|
+
* @internal
|
|
238
|
+
*/
|
|
239
|
+
get elementAspectExportCoordinator(): ElementAspectExportCoordinator;
|
|
240
|
+
/** Whether change traversal skips root-owned entities. */
|
|
241
|
+
private _skipPropagateChangesToRootElements;
|
|
242
|
+
private readonly _rootElementIds;
|
|
220
243
|
/** Construct a new IModelExporter
|
|
221
244
|
* @param sourceDb The source IModelDb
|
|
222
245
|
* @see registerHandler
|
|
223
246
|
*/
|
|
224
|
-
constructor(sourceDb: IModelDb
|
|
247
|
+
constructor(sourceDb: IModelDb);
|
|
225
248
|
/**
|
|
226
249
|
* Initialize prerequisites of exporting. This is implicitly done by any `export*` calls that need initialization
|
|
227
250
|
* which is currently just `exportChanges`.
|
|
@@ -234,7 +257,9 @@ export declare class IModelExporter {
|
|
|
234
257
|
registerHandler(handler: IModelExportHandler): void;
|
|
235
258
|
/** Add a rule to exclude a CodeSpec */
|
|
236
259
|
excludeCodeSpec(codeSpecName: string): void;
|
|
237
|
-
/** Add a rule to exclude a specific Element.
|
|
260
|
+
/** Add a rule to exclude a specific Element.
|
|
261
|
+
* @note Configure exclusions before starting an export operation. Changing exclusions while an export is in progress is unsupported.
|
|
262
|
+
*/
|
|
238
263
|
excludeElement(elementId: Id64String): void;
|
|
239
264
|
/** Add a rule to exclude all Elements in a specified Category. */
|
|
240
265
|
excludeElementsInCategory(categoryId: Id64String): void;
|
|
@@ -250,6 +275,7 @@ export declare class IModelExporter {
|
|
|
250
275
|
exportAll(): Promise<void>;
|
|
251
276
|
/** Export changes from the source iModel.
|
|
252
277
|
* Inserts, updates, and deletes are determined by inspecting the changeset(s).
|
|
278
|
+
* @throws [[ITwinError]] with scope `@itwin/imodel-transformer` and key `no-changesets` if the source iModel has no changesets and no custom changes. Call [[exportAll]] to export all content.
|
|
253
279
|
* @note To form a range of versions to process, set `startChangesetId` for the start (inclusive) of the desired
|
|
254
280
|
* range and open the source iModel as of the end (inclusive) of the desired range.
|
|
255
281
|
* @note the changedInstanceIds are just for this call to exportChanges, so you must continue to pass it in
|
|
@@ -257,6 +283,11 @@ export declare class IModelExporter {
|
|
|
257
283
|
*/
|
|
258
284
|
exportChanges(args?: ExportChangesOptions): Promise<void>;
|
|
259
285
|
private _resetChangeDataOnExport;
|
|
286
|
+
/** Enumerate schemas from the source iModel in database order.
|
|
287
|
+
* @note Override this method to customize schema discovery for both direct exports and transformer schema processing.
|
|
288
|
+
* @beta
|
|
289
|
+
*/
|
|
290
|
+
enumerateSchemas(): AsyncIterable<Schema>;
|
|
260
291
|
/** Export schemas from the source iModel.
|
|
261
292
|
* @note This must be called separately from [[exportAll]] or [[exportChanges]].
|
|
262
293
|
*/
|
|
@@ -300,6 +331,7 @@ export declare class IModelExporter {
|
|
|
300
331
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
301
332
|
*/
|
|
302
333
|
exportModel(modeledElementId: Id64String): Promise<void>;
|
|
334
|
+
private exportModelImpl;
|
|
303
335
|
/** Export the model (the container only) from the source iModel. */
|
|
304
336
|
private exportModelContainer;
|
|
305
337
|
private _yieldManager;
|
|
@@ -310,32 +342,99 @@ export declare class IModelExporter {
|
|
|
310
342
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
311
343
|
*/
|
|
312
344
|
exportModelContents(modelId: Id64String, elementClassFullName?: string, skipRootSubject?: boolean): Promise<void>;
|
|
345
|
+
private exportModelContentsImpl;
|
|
346
|
+
/** Whether the public element traversal methods still have their base implementations. */
|
|
347
|
+
private hasDefaultElementTraversal;
|
|
348
|
+
/** Whether hierarchy traversal can use the streamed query.
|
|
349
|
+
* Changes mode and overrides of the public traversal methods require legacy dispatch.
|
|
350
|
+
*/
|
|
351
|
+
private canUseSetBasedTraversal;
|
|
352
|
+
/** Stream element trees in the legacy depth-first order with one recursive ECSQL query.
|
|
353
|
+
* Rejected subtrees are skipped in the exporter without loading their descendants.
|
|
354
|
+
* @param anchorSelect a SELECT producing `(ECInstanceId, 0)` rows for the tree roots
|
|
355
|
+
*/
|
|
356
|
+
private exportElementTreesStreamed;
|
|
313
357
|
/** Export the sub-models directly below the specified model.
|
|
314
358
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
315
359
|
*/
|
|
316
360
|
exportSubModels(parentModelId: Id64String): Promise<void>;
|
|
361
|
+
private exportSubModelsImpl;
|
|
317
362
|
/** Returns true if the specified element should be exported.
|
|
318
363
|
* This considers the standard IModelExporter exclusion rules plus calls [IModelExportHandler.shouldExportElement]($transformer) for any custom exclusion rules.
|
|
319
364
|
* @note This method is called from within [[exportChanges]] and [[exportAll]], so usually does not need to be called directly.
|
|
320
365
|
*/
|
|
321
|
-
shouldExportElement(element: Element): boolean
|
|
322
|
-
/** Export the specified element
|
|
366
|
+
shouldExportElement(element: Element): Promise<boolean>;
|
|
367
|
+
/** Export the specified element and its child elements (if applicable).
|
|
323
368
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
369
|
+
* @note ElementAspects are exported separately in owner-scoped groups, so their callbacks are not guaranteed to follow this element callback.
|
|
324
370
|
*/
|
|
325
371
|
exportElement(elementId: Id64String): Promise<void>;
|
|
372
|
+
private exportElementImpl;
|
|
373
|
+
/** Returns the filter result for an unchanged ancestor on the current change-processing path, or `undefined` if it has not been filtered.
|
|
374
|
+
* @internal
|
|
375
|
+
*/
|
|
376
|
+
getUnchangedAncestorFilterResult(elementId: Id64String): boolean | undefined;
|
|
377
|
+
/** Filters the unchanged ancestors of a changed element, top-down, once each.
|
|
378
|
+
* @returns `false` if an ancestor is rejected.
|
|
379
|
+
*/
|
|
380
|
+
private acceptUnchangedAncestors;
|
|
381
|
+
/** Runs the export callbacks for a single element without visiting its children.
|
|
382
|
+
* @returns how to continue with the element's children: skip them, visit them, or pass through an unchanged element to reach changed descendants.
|
|
383
|
+
*/
|
|
384
|
+
private exportElementShallow;
|
|
326
385
|
/** Export the child elements of the specified element from the source iModel.
|
|
327
386
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
328
387
|
*/
|
|
329
388
|
exportChildElements(elementId: Id64String): Promise<void>;
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
389
|
+
private exportChildElementsImpl;
|
|
390
|
+
/** Whether change processing may use the sparse hierarchy as the child-id source.
|
|
391
|
+
* Custom traversal overrides retain the previous full element dispatch.
|
|
392
|
+
*/
|
|
393
|
+
private canUseChangedElementForest;
|
|
394
|
+
private getOverriddenElementTraversalMethods;
|
|
395
|
+
private disableChangedElementForest;
|
|
396
|
+
private createChangedElementForest;
|
|
397
|
+
private getChangedElementForest;
|
|
398
|
+
/** Exports all aspects owned by the supplied elements. */
|
|
399
|
+
private exportAspectsForOwners;
|
|
400
|
+
private filterOwnerElementIdsForAspectExport;
|
|
401
|
+
private shouldExportElementHierarchyForAspect;
|
|
402
|
+
private shouldExportModelForAspect;
|
|
403
|
+
private beginChangedElementTraversalScope;
|
|
404
|
+
private endChangedElementTraversalScope;
|
|
405
|
+
private runScopedElementExport;
|
|
406
|
+
/** Apply the element export filter when deciding whether to process an aspect owner. @internal */
|
|
407
|
+
private shouldExportElementForAspect;
|
|
408
|
+
private shouldExportElementFact;
|
|
409
|
+
private queryAspectElementHierarchyFacts;
|
|
410
|
+
private queryAspectElementFacts;
|
|
411
|
+
private queryAspectModelHierarchyFacts;
|
|
412
|
+
private getAspectOwnerIdBatches;
|
|
333
413
|
/** Exports all relationships that subclass from the specified base class.
|
|
334
414
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
415
|
+
* @note This is the bulk traversal path. It hydrates relationships with one streaming query and calls [[exportRelationshipInstance]] directly; it does not call [[exportRelationship]] once per row.
|
|
335
416
|
*/
|
|
336
417
|
exportRelationships(baseRelClassFullName: string): Promise<void>;
|
|
337
|
-
/**
|
|
418
|
+
/** Builds the raw relationship query used by the bulk and targeted export paths. */
|
|
419
|
+
private getRelationshipQuery;
|
|
420
|
+
/** Applies the changeset filter (when exporting changes) to a relationship instance id.
|
|
421
|
+
* @returns whether to skip the relationship, and whether the export is an update.
|
|
422
|
+
*/
|
|
423
|
+
private checkRelationshipChangesetFilter;
|
|
424
|
+
/** Converts a raw `$` instance-access row into [RelationshipProps]($common). */
|
|
425
|
+
private getRelationshipProps;
|
|
426
|
+
/** Export one specified relationship from the source iModel.
|
|
427
|
+
* @note This targeted path is separate from [[exportRelationships]], which traverses a class hierarchy. It uses the same raw instance query and passes endpoint FederationGuids to the handler.
|
|
428
|
+
*/
|
|
338
429
|
exportRelationship(relClassFullName: string, relInstanceId: Id64String): Promise<void>;
|
|
430
|
+
/** Hydrates a relationship query row and runs the common export pipeline. */
|
|
431
|
+
private exportHydratedRelationship;
|
|
432
|
+
/** Applies exclusion rules and handler callbacks to an already-hydrated relationship instance.
|
|
433
|
+
* @param sourceFedGuid The FederationGuid of the relationship's source endpoint, if available.
|
|
434
|
+
* @param targetFedGuid The FederationGuid of the relationship's target endpoint, if available.
|
|
435
|
+
* @note This is the common protected hook used by both [[exportRelationship]] and [[exportRelationships]]. Most consumers should customize [[IModelExportHandler]] instead.
|
|
436
|
+
*/
|
|
437
|
+
protected exportRelationshipInstance(relationship: Relationship, isUpdate: boolean | undefined, sourceFedGuid?: GuidString, targetFedGuid?: GuidString): Promise<void>;
|
|
339
438
|
/** Tracks incremental progress */
|
|
340
439
|
private trackProgress;
|
|
341
440
|
}
|
|
@@ -378,6 +477,11 @@ export declare class ChangedInstanceIds {
|
|
|
378
477
|
private _aspectSubclassIds?;
|
|
379
478
|
private _relationshipSubclassIds?;
|
|
380
479
|
private _relationshipSubclassIdsToSkip?;
|
|
480
|
+
private readonly _aspectOwnerElementIds;
|
|
481
|
+
/** Element IDs that own the aspects represented by `aspect` changes.
|
|
482
|
+
* @internal
|
|
483
|
+
*/
|
|
484
|
+
get aspectOwnerElementIds(): ReadonlySet<Id64String>;
|
|
381
485
|
private _db;
|
|
382
486
|
constructor(db: IModelDb);
|
|
383
487
|
private setupECClassIds;
|
|
@@ -392,12 +496,14 @@ export declare class ChangedInstanceIds {
|
|
|
392
496
|
*/
|
|
393
497
|
get hasChanges(): boolean;
|
|
394
498
|
/**
|
|
395
|
-
* Adds the provided [[
|
|
499
|
+
* Adds the provided [[ChangeInstance]] to the appropriate set of changes by class type (codeSpec, model, element, aspect, or relationship) maintained by this instance of ChangedInstanceIds.
|
|
396
500
|
* If the same ECInstanceId is seen multiple times, the changedInstanceIds will be modified accordingly, i.e. if an id 'x' was updated but now we see 'x' was deleted, we will remove 'x'
|
|
397
501
|
* from the set of updatedIds and add it to the set of deletedIds for the appropriate class type.
|
|
398
|
-
* @param change
|
|
502
|
+
* @param change Changed EC instance with the ID, operation, and EC class ID of the changed entity.
|
|
399
503
|
*/
|
|
400
|
-
addChange(change:
|
|
504
|
+
addChange(change: ChangeInstance): Promise<void>;
|
|
505
|
+
private recordChange;
|
|
506
|
+
private tryGetAspectOwnerElementId;
|
|
401
507
|
/**
|
|
402
508
|
* This method should only be called inside [[IModelTransformer.addCustomChanges]].
|
|
403
509
|
* It adds the provided change to the element changes maintained by this instance of ChangedInstanceIds.
|
|
@@ -429,10 +535,13 @@ export declare class ChangedInstanceIds {
|
|
|
429
535
|
* If the same ECInstanceId is seen multiple times, the changedInstanceIds will be modified accordingly, i.e. if an id 'x' was updated but now we see 'x' was deleted, we will remove 'x'
|
|
430
536
|
* from the set of updatedIds and add it to the set of deletedIds for the appropriate class type.
|
|
431
537
|
* @note It is the responsibility of the caller to ensure that the provided id is, in fact an aspect.
|
|
538
|
+
* @param elementIds Owning element IDs. Required when `changeType` is
|
|
539
|
+
* `Deleted` or the source aspect row is unavailable.
|
|
432
540
|
* @note In most cases, this method does not need to be called. Its only for consumers to mimic changes as if they were found in a changeset, which should only be useful in certain cases such as the changing of filter criteria for a preexisting master branch relationship.
|
|
433
541
|
* @beta
|
|
434
542
|
*/
|
|
435
|
-
addCustomAspectChange(changeType: SqliteChangeOp, ids: Id64Arg): void;
|
|
543
|
+
addCustomAspectChange(changeType: SqliteChangeOp, ids: Id64Arg, elementIds?: Id64Arg): void;
|
|
544
|
+
private recordCustomAspectChange;
|
|
436
545
|
/**
|
|
437
546
|
* There is an optimization in [IModelExporter.exportModelContents] which doesn't try to export elements within a model unless the model itself is marked as `Updated` or 'Inserted' in sourceDbChanges. This method is used in [[addCustomElementChange]] and [[addCustomModelChange]] to add the parent model hierarchy to the 'updatedIds' so that the custom element changes are exported.
|
|
438
547
|
* Transformer will insert 'Updated' model to target if it does not exist there already. To handle such case, modeled elements of parent models are also marked as updated. This is done, because model can not be inserted without it's modeled element.
|
|
@@ -446,5 +555,9 @@ export declare class ChangedInstanceIds {
|
|
|
446
555
|
* @public
|
|
447
556
|
*/
|
|
448
557
|
static initialize(opts: ChangedInstanceIdsInitOptions): Promise<ChangedInstanceIds | undefined>;
|
|
558
|
+
/** Record an ordered batch, then resolve missing aspect owners against current source state.
|
|
559
|
+
* @internal
|
|
560
|
+
*/
|
|
561
|
+
addChanges(changes: Iterable<ChangeInstance>): Promise<void>;
|
|
449
562
|
}
|
|
450
563
|
//# sourceMappingURL=IModelExporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelExporter.d.ts","sourceRoot":"","sources":["../../src/IModelExporter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,WAAW,EAEX,
|
|
1
|
+
{"version":3,"file":"IModelExporter.d.ts","sourceRoot":"","sources":["../../src/IModelExporter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,WAAW,EAEX,cAAc,EAGd,OAAO,EACP,aAAa,EACb,kBAAkB,EAElB,mBAAmB,EAEnB,QAAQ,EACR,cAAc,EACd,KAAK,EAEL,YAAY,EACZ,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,UAAU,EAEV,OAAO,EAEP,UAAU,EAMX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,kBAAkB,EAClB,QAAQ,EAER,oBAAoB,EAEpB,SAAS,EAKV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAa,MAAM,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAIxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAwBlF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C,CAAC;;;GAGC,GAAG,CACF;IAAE,WAAW,EAAE,kBAAkB,EAAE,CAAA;CAAE;AACvC;;;;;GAKG;GACD;IAAE,kBAAk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