@itwin/imodel-transformer 1.0.0-dev.16 → 1.0.0-dev.18
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/lib/cjs/IModelExporter.d.ts +3 -1
- package/lib/cjs/IModelExporter.d.ts.map +1 -1
- package/lib/cjs/IModelExporter.js +3 -1
- package/lib/cjs/IModelExporter.js.map +1 -1
- package/lib/cjs/IModelTransformer.d.ts +22 -54
- package/lib/cjs/IModelTransformer.d.ts.map +1 -1
- package/lib/cjs/IModelTransformer.js +117 -186
- package/lib/cjs/IModelTransformer.js.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/PendingReferenceMap.d.ts +0 -37
- package/lib/cjs/PendingReferenceMap.d.ts.map +0 -1
- package/lib/cjs/PendingReferenceMap.js +0 -92
- package/lib/cjs/PendingReferenceMap.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTransformer.d.ts","sourceRoot":"","sources":["../../src/IModelTransformer.ts"],"names":[],"mappings":"AAUA,OAAO,EAML,SAAS,EACT,UAAU,EAKX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAaL,OAAO,EACP,aAAa,EACb,kBAAkB,EAGlB,mBAAmB,EACnB,MAAM,EAGN,oBAAoB,EAKpB,QAAQ,EAKR,KAAK,EAGL,YAAY,EACZ,iBAAiB,EAMlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,mBAAmB,EAGnB,QAAQ,EAER,kBAAkB,EAClB,YAAY,
|
|
1
|
+
{"version":3,"file":"IModelTransformer.d.ts","sourceRoot":"","sources":["../../src/IModelTransformer.ts"],"names":[],"mappings":"AAUA,OAAO,EAML,SAAS,EACT,OAAO,EACP,UAAU,EAKX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAaL,OAAO,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aAAa,EAAE,UAAU,EACzB,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAkBvC;;;;;;OAMG;IACU,eAAe,CAC1B,qBAAqB,EAAE,UAAU,EACjC,aAAa,EAAE,UAAU,EACzB,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAkBvC,4EAA4E;IAC5D,kBAAkB,CAAC,aAAa,EAAE,OAAO,GAAG,YAAY;CAqDzE"}
|
|
@@ -19,8 +19,6 @@ const core_common_1 = require("@itwin/core-common");
|
|
|
19
19
|
const IModelExporter_1 = require("./IModelExporter");
|
|
20
20
|
const IModelImporter_1 = require("./IModelImporter");
|
|
21
21
|
const TransformerLoggerCategory_1 = require("./TransformerLoggerCategory");
|
|
22
|
-
const PendingReferenceMap_1 = require("./PendingReferenceMap");
|
|
23
|
-
const EntityMap_1 = require("./EntityMap");
|
|
24
22
|
const IModelCloneContext_1 = require("./IModelCloneContext");
|
|
25
23
|
const EntityUnifier_1 = require("./EntityUnifier");
|
|
26
24
|
const Algo_1 = require("./Algo");
|
|
@@ -31,30 +29,6 @@ const nullLastProvenanceEntityInfo = {
|
|
|
31
29
|
aspectVersion: "",
|
|
32
30
|
aspectKind: core_backend_1.ExternalSourceAspect.Kind.Element,
|
|
33
31
|
};
|
|
34
|
-
/**
|
|
35
|
-
* A container for tracking the state of a partially committed entity and finalizing it when it's ready to be fully committed
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
class PartiallyCommittedEntity {
|
|
39
|
-
constructor(
|
|
40
|
-
/**
|
|
41
|
-
* A set of "model|element ++ ID64" pairs, (e.g. `model0x11` or `element0x12`)
|
|
42
|
-
* It is possible for the submodel of an element to be separately resolved from the actual element,
|
|
43
|
-
* so its resolution must be tracked separately
|
|
44
|
-
*/
|
|
45
|
-
_missingReferences, _onComplete) {
|
|
46
|
-
this._missingReferences = _missingReferences;
|
|
47
|
-
this._onComplete = _onComplete;
|
|
48
|
-
}
|
|
49
|
-
resolveReference(id) {
|
|
50
|
-
this._missingReferences.delete(id);
|
|
51
|
-
if (this._missingReferences.size === 0)
|
|
52
|
-
this._onComplete();
|
|
53
|
-
}
|
|
54
|
-
forceComplete() {
|
|
55
|
-
this._onComplete();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
32
|
/**
|
|
59
33
|
* Apply a function to each Id64 in a supported container type of Id64s.
|
|
60
34
|
* Currently only supports raw Id64String or RelatedElement-like objects containing an `id` property that is a Id64String,
|
|
@@ -217,13 +191,10 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
217
191
|
*/
|
|
218
192
|
constructor(source, target, options) {
|
|
219
193
|
super();
|
|
220
|
-
/** map of (unprocessed element, referencing processed element) pairs to the partially committed element that needs the reference resolved
|
|
221
|
-
* and have some helper methods below for now */
|
|
222
|
-
this._pendingReferences = new PendingReferenceMap_1.PendingReferenceMap();
|
|
223
194
|
/** a set of elements for which source provenance will be explicitly tracked by ExternalSourceAspects */
|
|
224
195
|
this._elementsWithExplicitlyTrackedProvenance = new Set();
|
|
225
|
-
|
|
226
|
-
this.
|
|
196
|
+
this._partiallyCommittedElementIds = new Set();
|
|
197
|
+
this._partiallyCommittedAspectIds = new Set();
|
|
227
198
|
/**
|
|
228
199
|
* A private variable meant to be set by tests which have an outdated way of setting up transforms. In all synchronizations today we expect to find an ESA in the branch db which describes the master -> branch relationship.
|
|
229
200
|
* The exception to this is the first transform aka the provenance initializing transform which requires that the master imodel and the branch imodel are identical at the time of provenance initialization.
|
|
@@ -232,10 +203,6 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
232
203
|
*/
|
|
233
204
|
this._allowNoScopingESA = false;
|
|
234
205
|
this._changesetRanges = undefined;
|
|
235
|
-
/** Set of entity keys which were not exported and don't need to be tracked for pending reference resolution.
|
|
236
|
-
* @note Currently only tracks elements which were not exported.
|
|
237
|
-
*/
|
|
238
|
-
this._skippedEntities = new Set();
|
|
239
206
|
/**
|
|
240
207
|
* Previously the transformer would insert provenance always pointing to the "target" relationship.
|
|
241
208
|
* It should (and now by default does) instead insert provenance pointing to the provenanceSource
|
|
@@ -954,80 +921,69 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
954
921
|
nodeAssert(this._hasElementChangedCache !== undefined, "has element changed cache should be initialized by now");
|
|
955
922
|
return this._hasElementChangedCache.has(sourceElement.id);
|
|
956
923
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
(0, core_bentley_1.assert)(false, `unreachable; entity was '${entity.constructor.name}' not an Element, Relationship, or ElementAspect`);
|
|
968
|
-
}
|
|
969
|
-
/** callback to perform when a partial element says it's ready to be completed
|
|
970
|
-
* transforms the source element with all references now valid, then updates the partial element with the results
|
|
971
|
-
*/
|
|
972
|
-
makePartialEntityCompleter(sourceEntity) {
|
|
973
|
-
return () => {
|
|
974
|
-
const targetId = this.context.findTargetEntityId(core_backend_1.EntityReferences.from(sourceEntity));
|
|
975
|
-
if (!core_backend_1.EntityReferences.isValid(targetId))
|
|
976
|
-
throw Error(`${sourceEntity.id} has not been inserted into the target yet, the completer is invalid. This is a bug.`);
|
|
977
|
-
const onEntityTransform = IModelTransformer.transformCallbackFor(this, sourceEntity);
|
|
978
|
-
const updateEntity = EntityUnifier_1.EntityUnifier.updaterFor(this.targetDb, sourceEntity);
|
|
979
|
-
const targetProps = onEntityTransform.call(this, sourceEntity);
|
|
980
|
-
if (sourceEntity instanceof core_backend_1.Relationship) {
|
|
981
|
-
targetProps.sourceId =
|
|
982
|
-
this.context.findTargetElementId(sourceEntity.sourceId);
|
|
983
|
-
targetProps.targetId =
|
|
984
|
-
this.context.findTargetElementId(sourceEntity.targetId);
|
|
924
|
+
completePartiallyCommittedElements() {
|
|
925
|
+
for (const sourceElementId of this._partiallyCommittedElementIds) {
|
|
926
|
+
const sourceElement = this.sourceDb.elements.getElement({
|
|
927
|
+
id: sourceElementId,
|
|
928
|
+
wantGeometry: this.exporter.wantGeometry,
|
|
929
|
+
wantBRepData: this.exporter.wantGeometry,
|
|
930
|
+
});
|
|
931
|
+
const targetId = this.context.findTargetElementId(sourceElementId);
|
|
932
|
+
if (core_bentley_1.Id64.isInvalid(targetId)) {
|
|
933
|
+
throw new Error(`source-target element mapping not found for element "${sourceElementId}" when completing partially committed elements. This is a bug.`);
|
|
985
934
|
}
|
|
986
|
-
|
|
987
|
-
this.
|
|
988
|
-
}
|
|
935
|
+
const targetProps = this.onTransformElement(sourceElement);
|
|
936
|
+
this.targetDb.elements.updateElement({ ...targetProps, id: targetId });
|
|
937
|
+
}
|
|
989
938
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
this._skippedEntities.has(referenceId);
|
|
1002
|
-
if (alreadyProcessed)
|
|
1003
|
-
continue;
|
|
1004
|
-
core_bentley_1.Logger.logTrace(loggerCategory, `Deferring resolution of reference '${referenceId}' of element '${entity.id}'`);
|
|
1005
|
-
const referencedExistsInSource = EntityUnifier_1.EntityUnifier.exists(this.sourceDb, {
|
|
1006
|
-
entityReference: referenceId,
|
|
939
|
+
completePartiallyCommittedAspects() {
|
|
940
|
+
for (const sourceAspectId of this._partiallyCommittedAspectIds) {
|
|
941
|
+
const sourceAspect = this.sourceDb.elements.getAspect(sourceAspectId);
|
|
942
|
+
const targetAspectId = this.context.findTargetAspectId(sourceAspectId);
|
|
943
|
+
if (core_bentley_1.Id64.isInvalid(targetAspectId)) {
|
|
944
|
+
throw new Error(`source-target aspect mapping not found for aspect "${sourceAspectId}" when completing partially committed aspects. This is a bug.`);
|
|
945
|
+
}
|
|
946
|
+
const targetAspectProps = this.onTransformElementAspect(sourceAspect);
|
|
947
|
+
this.targetDb.elements.updateAspect({
|
|
948
|
+
...targetAspectProps,
|
|
949
|
+
id: targetAspectId,
|
|
1007
950
|
});
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
doAllReferencesExistInTarget(entity) {
|
|
954
|
+
let allReferencesExist = true;
|
|
955
|
+
for (const referenceId of entity.getReferenceIds()) {
|
|
956
|
+
const referencedEntityId = core_backend_1.EntityReferences.toId64(referenceId);
|
|
957
|
+
if (referencedEntityId === core_common_1.IModel.repositoryModelId ||
|
|
958
|
+
referencedEntityId === core_common_1.IModel.dictionaryId ||
|
|
959
|
+
referencedEntityId === "0xe") {
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
if (allReferencesExist &&
|
|
963
|
+
!core_backend_1.EntityReferences.isValid(this.context.findTargetEntityId(referenceId))) {
|
|
964
|
+
// if we care about references existing then we cannot return early and must check all other references.
|
|
965
|
+
if (this._options.danglingReferencesBehavior === "ignore") {
|
|
966
|
+
return false;
|
|
1021
967
|
}
|
|
968
|
+
allReferencesExist = false;
|
|
1022
969
|
}
|
|
1023
|
-
if (
|
|
1024
|
-
|
|
1025
|
-
if (!this._partiallyCommittedEntities.has(entity))
|
|
1026
|
-
this._partiallyCommittedEntities.set(entity, thisPartialElem);
|
|
970
|
+
if (this._options.danglingReferencesBehavior === "reject") {
|
|
971
|
+
this.assertReferenceExistsInSource(referenceId, entity);
|
|
1027
972
|
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
973
|
+
}
|
|
974
|
+
return allReferencesExist;
|
|
975
|
+
}
|
|
976
|
+
assertReferenceExistsInSource(referenceId, entity) {
|
|
977
|
+
const referencedExistsInSource = EntityUnifier_1.EntityUnifier.exists(this.sourceDb, {
|
|
978
|
+
entityReference: referenceId,
|
|
979
|
+
});
|
|
980
|
+
if (!referencedExistsInSource) {
|
|
981
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, [
|
|
982
|
+
`Found a reference to an element "${referenceId}" that doesn't exist while looking for references of "${entity.id}".`,
|
|
983
|
+
"This must have been caused by an upstream application that changed the iModel.",
|
|
984
|
+
"You can set the IModelTransformOptions.danglingReferencesBehavior option to 'ignore' to ignore this,",
|
|
985
|
+
`and the referenceId found on "${entity.id}" will not be carried over to corresponding target element.`,
|
|
986
|
+
].join("\n"));
|
|
1031
987
|
}
|
|
1032
988
|
}
|
|
1033
989
|
/** Cause the specified Element and its child Elements (if applicable) to be exported from the source iModel and imported into the target iModel.
|
|
@@ -1055,24 +1011,6 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1055
1011
|
shouldExportElement(_sourceElement) {
|
|
1056
1012
|
return true;
|
|
1057
1013
|
}
|
|
1058
|
-
onSkipElement(sourceElementId) {
|
|
1059
|
-
if (this.context.findTargetElementId(sourceElementId) !== core_bentley_1.Id64.invalid) {
|
|
1060
|
-
// element already has provenance
|
|
1061
|
-
return;
|
|
1062
|
-
}
|
|
1063
|
-
core_bentley_1.Logger.logInfo(loggerCategory, `Element '${sourceElementId}' won't be exported. Marking its references as resolved`);
|
|
1064
|
-
const elementKey = `e${sourceElementId}`;
|
|
1065
|
-
this._skippedEntities.add(elementKey);
|
|
1066
|
-
// Mark any existing pending references to the skipped element as resolved.
|
|
1067
|
-
for (const referencer of this._pendingReferences.getReferencersByEntityKey(elementKey)) {
|
|
1068
|
-
const key = PendingReferenceMap_1.PendingReference.from(referencer, elementKey);
|
|
1069
|
-
const pendingRef = this._pendingReferences.get(key);
|
|
1070
|
-
if (!pendingRef)
|
|
1071
|
-
continue;
|
|
1072
|
-
pendingRef.resolveReference(elementKey);
|
|
1073
|
-
this._pendingReferences.delete(key);
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
1014
|
/**
|
|
1077
1015
|
* If they haven't been already, import all of the required references
|
|
1078
1016
|
* @internal do not call, override or implement this, it will be removed
|
|
@@ -1182,7 +1120,9 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1182
1120
|
}
|
|
1183
1121
|
if (!this.hasElementChanged(sourceElement))
|
|
1184
1122
|
return;
|
|
1185
|
-
this.
|
|
1123
|
+
if (!this.doAllReferencesExistInTarget(sourceElement)) {
|
|
1124
|
+
this._partiallyCommittedElementIds.add(sourceElement.id);
|
|
1125
|
+
}
|
|
1186
1126
|
// targetElementId will be valid (indicating update) or undefined (indicating insert)
|
|
1187
1127
|
targetElementProps.id = core_bentley_1.Id64.isValid(targetElementId)
|
|
1188
1128
|
? targetElementId
|
|
@@ -1191,8 +1131,6 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1191
1131
|
this.importer.importElement(targetElementProps); // don't need to import if iModel was copied
|
|
1192
1132
|
}
|
|
1193
1133
|
this.context.remapElement(sourceElement.id, targetElementProps.id); // targetElementProps.id assigned by importElement
|
|
1194
|
-
// now that we've mapped this elem we can fix unmapped references to it
|
|
1195
|
-
this.resolvePendingReferences(sourceElement);
|
|
1196
1134
|
// the transformer does not currently 'split' or 'join' any elements, therefore, it does not
|
|
1197
1135
|
// insert external source aspects because federation guids are sufficient for this.
|
|
1198
1136
|
// Other transformer subclasses must insert the appropriate aspect (as provided by a TBD API)
|
|
@@ -1220,16 +1158,6 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1220
1158
|
this.markLastProvenance(provenance, { isRelationship: false });
|
|
1221
1159
|
}
|
|
1222
1160
|
}
|
|
1223
|
-
resolvePendingReferences(entity) {
|
|
1224
|
-
for (const referencer of this._pendingReferences.getReferencers(entity)) {
|
|
1225
|
-
const key = PendingReferenceMap_1.PendingReference.from(referencer, entity);
|
|
1226
|
-
const pendingRef = this._pendingReferences.get(key);
|
|
1227
|
-
if (!pendingRef)
|
|
1228
|
-
continue;
|
|
1229
|
-
pendingRef.resolveReference(core_backend_1.EntityReferences.from(entity));
|
|
1230
|
-
this._pendingReferences.delete(key);
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
1161
|
/** Override of [IModelExportHandler.onDeleteElement]($transformer) that is called when [IModelExporter]($transformer) detects that an Element has been deleted from the source iModel.
|
|
1234
1162
|
* This override propagates the delete to the target iModel via [IModelImporter.deleteElement]($transformer).
|
|
1235
1163
|
*/
|
|
@@ -1254,7 +1182,6 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1254
1182
|
return;
|
|
1255
1183
|
const targetModelProps = this.onTransformModel(sourceModel, targetModeledElementId);
|
|
1256
1184
|
this.importer.importModel(targetModelProps);
|
|
1257
|
-
this.resolvePendingReferences(sourceModel);
|
|
1258
1185
|
}
|
|
1259
1186
|
/** Override of [IModelExportHandler.onDeleteModel]($transformer) that is called when [IModelExporter]($transformer) detects that a [Model]($backend) has been deleted from the source iModel. */
|
|
1260
1187
|
onDeleteModel(sourceModelId) {
|
|
@@ -1395,42 +1322,50 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1395
1322
|
targetModelProps.parentModel = this.context.findTargetElementId(targetModelProps.parentModel);
|
|
1396
1323
|
return targetModelProps;
|
|
1397
1324
|
}
|
|
1398
|
-
/**
|
|
1325
|
+
/**
|
|
1326
|
+
* Called at the end of a transformation,
|
|
1399
1327
|
* updates the target scope element to say that transformation up through the
|
|
1400
1328
|
* source's changeset has been performed. Also stores all changesets that occurred
|
|
1401
1329
|
* during the transformation as "pending synchronization changeset indices" @see TargetScopeProvenanceJsonProps
|
|
1402
1330
|
*
|
|
1403
1331
|
* You generally should not call this function yourself and use [[process]] with [[IModelTransformOptions.argsForProcessChanges]] provided instead.
|
|
1404
1332
|
* It is public for unsupported use cases of custom synchronization transforms.
|
|
1405
|
-
* @note
|
|
1406
|
-
*
|
|
1333
|
+
* @note If [[IModelTransformOptions.argsForProcessChanges]] is not defined in this transformation, this function will return early without updating the sync version,
|
|
1334
|
+
* unless the `initializeReverseSyncVersion` option is set to `true`
|
|
1335
|
+
*
|
|
1336
|
+
* The `initializeReverseSyncVersion` is added to set the reverse synchronization version during a forward synchronization.
|
|
1337
|
+
* When set to `true`, it saves the reverse sync version as the current changeset of the targetDb. This is typically used for the first transformation between a master and branch iModel.
|
|
1338
|
+
* Setting `initializeReverseSyncVersion` to `true` has the effect of making it so any changesets in the branch iModel at the time of the first transformation will be ignored during any future reverse synchronizations from the branch to the master iModel.
|
|
1339
|
+
*
|
|
1340
|
+
* Note that typically, the reverseSyncVersion is saved as the last changeset merged from the branch into master.
|
|
1341
|
+
* Setting initializeReverseSyncVersion to true during a forward transformation could overwrite this correct reverseSyncVersion and should only be done during the first transformation between a master and branch iModel.
|
|
1407
1342
|
*/
|
|
1408
|
-
updateSynchronizationVersion({
|
|
1409
|
-
const
|
|
1410
|
-
this._sourceChangeDataState !== "has-changes"
|
|
1411
|
-
|
|
1412
|
-
if (notForcedAndHasNoChangesAndIsntProvenanceInit)
|
|
1343
|
+
updateSynchronizationVersion({ initializeReverseSyncVersion = false, } = {}) {
|
|
1344
|
+
const shouldSkipSyncVersionUpdate = !initializeReverseSyncVersion &&
|
|
1345
|
+
this._sourceChangeDataState !== "has-changes";
|
|
1346
|
+
if (shouldSkipSyncVersionUpdate)
|
|
1413
1347
|
return;
|
|
1414
1348
|
nodeAssert(this._targetScopeProvenanceProps);
|
|
1415
1349
|
const sourceVersion = `${this.sourceDb.changeset.id};${this.sourceDb.changeset.index}`;
|
|
1416
1350
|
const targetVersion = `${this.targetDb.changeset.id};${this.targetDb.changeset.index}`;
|
|
1417
|
-
if (this.
|
|
1418
|
-
this._targetScopeProvenanceProps.version = sourceVersion;
|
|
1419
|
-
this._targetScopeProvenanceProps.jsonProperties.reverseSyncVersion =
|
|
1420
|
-
targetVersion;
|
|
1421
|
-
}
|
|
1422
|
-
else if (this.isReverseSynchronization) {
|
|
1351
|
+
if (this.isReverseSynchronization) {
|
|
1423
1352
|
const oldVersion = this._targetScopeProvenanceProps.jsonProperties.reverseSyncVersion;
|
|
1424
1353
|
core_bentley_1.Logger.logInfo(loggerCategory, `updating reverse version from ${oldVersion} to ${sourceVersion}`);
|
|
1425
1354
|
this._targetScopeProvenanceProps.jsonProperties.reverseSyncVersion =
|
|
1426
1355
|
sourceVersion;
|
|
1427
1356
|
}
|
|
1428
|
-
else
|
|
1357
|
+
else {
|
|
1429
1358
|
core_bentley_1.Logger.logInfo(loggerCategory, `updating sync version from ${this._targetScopeProvenanceProps.version} to ${sourceVersion}`);
|
|
1430
1359
|
this._targetScopeProvenanceProps.version = sourceVersion;
|
|
1360
|
+
// save reverse sync version
|
|
1361
|
+
if (initializeReverseSyncVersion) {
|
|
1362
|
+
core_bentley_1.Logger.logInfo(loggerCategory, `updating reverse sync version from ${this._targetScopeProvenanceProps.jsonProperties.reverseSyncVersion} to ${targetVersion}`);
|
|
1363
|
+
this._targetScopeProvenanceProps.jsonProperties.reverseSyncVersion =
|
|
1364
|
+
targetVersion;
|
|
1365
|
+
}
|
|
1431
1366
|
}
|
|
1432
1367
|
if (this._options.argsForProcessChanges ||
|
|
1433
|
-
(this._startingChangesetIndices &&
|
|
1368
|
+
(this._startingChangesetIndices && initializeReverseSyncVersion)) {
|
|
1434
1369
|
nodeAssert(this.targetDb.changeset.index !== undefined &&
|
|
1435
1370
|
this._startingChangesetIndices !== undefined, "updateSynchronizationVersion was called without change history");
|
|
1436
1371
|
const jsonProps = this._targetScopeProvenanceProps.jsonProperties;
|
|
@@ -1438,16 +1373,17 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1438
1373
|
core_bentley_1.Logger.logTrace(loggerCategory, `previous pendingSyncChanges: ${jsonProps.pendingSyncChangesetIndices}`);
|
|
1439
1374
|
const pendingSyncChangesetIndicesKey = "pendingSyncChangesetIndices";
|
|
1440
1375
|
const pendingReverseSyncChangesetIndicesKey = "pendingReverseSyncChangesetIndices";
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1376
|
+
// Determine which keys to clear and update based on the synchronization direction
|
|
1377
|
+
let syncChangesetsToClearKey;
|
|
1378
|
+
let syncChangesetsToUpdateKey;
|
|
1379
|
+
if (this.isReverseSynchronization) {
|
|
1380
|
+
syncChangesetsToClearKey = pendingReverseSyncChangesetIndicesKey;
|
|
1381
|
+
syncChangesetsToUpdateKey = pendingSyncChangesetIndicesKey;
|
|
1382
|
+
}
|
|
1383
|
+
else {
|
|
1384
|
+
syncChangesetsToClearKey = pendingSyncChangesetIndicesKey;
|
|
1385
|
+
syncChangesetsToUpdateKey = pendingReverseSyncChangesetIndicesKey;
|
|
1386
|
+
}
|
|
1451
1387
|
// NOTE that as documented in [[processChanges]], this assumes that right after
|
|
1452
1388
|
// transformation finalization, the work will be saved immediately, otherwise we've
|
|
1453
1389
|
// just marked this changeset as a synchronization to ignore, and the user can add other
|
|
@@ -1476,21 +1412,9 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1476
1412
|
// FIXME<MIKE>: is this necessary when manually using low level transform APIs? (document if so)
|
|
1477
1413
|
finalizeTransformation() {
|
|
1478
1414
|
this.importer.finalize();
|
|
1479
|
-
this.updateSynchronizationVersion(
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
"The following elements were never fully resolved:",
|
|
1483
|
-
[...this._partiallyCommittedEntities.keys()].join(","),
|
|
1484
|
-
"This indicates that either some references were excluded from the transformation",
|
|
1485
|
-
"or the source has dangling references.",
|
|
1486
|
-
].join("\n");
|
|
1487
|
-
if (this._options.danglingReferencesBehavior === "reject")
|
|
1488
|
-
throw new Error(message);
|
|
1489
|
-
core_bentley_1.Logger.logWarning(loggerCategory, message);
|
|
1490
|
-
for (const partiallyCommittedElem of this._partiallyCommittedEntities.values()) {
|
|
1491
|
-
partiallyCommittedElem.forceComplete();
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1415
|
+
this.updateSynchronizationVersion({
|
|
1416
|
+
initializeReverseSyncVersion: this._isProvenanceInitTransform,
|
|
1417
|
+
});
|
|
1494
1418
|
// TODO: ignore if we remove change cache usage
|
|
1495
1419
|
if (!this._options.noDetachChangeCache) {
|
|
1496
1420
|
if (core_backend_1.ChangeSummaryManager.isChangeCacheAttached(this.sourceDb))
|
|
@@ -1647,22 +1571,25 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1647
1571
|
* This override calls [[onTransformElementAspect]] and then [IModelImporter.importElementUniqueAspect]($transformer) to update the target iModel.
|
|
1648
1572
|
*/
|
|
1649
1573
|
onExportElementUniqueAspect(sourceAspect) {
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1652
|
-
|
|
1574
|
+
const targetAspectProps = this.onTransformElementAspect(sourceAspect);
|
|
1575
|
+
if (!this.doAllReferencesExistInTarget(sourceAspect)) {
|
|
1576
|
+
this._partiallyCommittedAspectIds.add(sourceAspect.id);
|
|
1577
|
+
}
|
|
1653
1578
|
const targetId = this.importer.importElementUniqueAspect(targetAspectProps);
|
|
1654
1579
|
this.context.remapElementAspect(sourceAspect.id, targetId);
|
|
1655
|
-
this.resolvePendingReferences(sourceAspect);
|
|
1656
1580
|
}
|
|
1657
1581
|
/** Override of [IModelExportHandler.onExportElementMultiAspects]($transformer) that imports ElementMultiAspects into the target iModel when they are exported from the source iModel.
|
|
1658
1582
|
* This override calls [[onTransformElementAspect]] for each ElementMultiAspect and then [IModelImporter.importElementMultiAspects]($transformer) to update the target iModel.
|
|
1659
1583
|
* @note ElementMultiAspects are handled as a group to make it easier to differentiate between insert, update, and delete.
|
|
1660
1584
|
*/
|
|
1661
1585
|
onExportElementMultiAspects(sourceAspects) {
|
|
1662
|
-
const targetElementId = this.context.findTargetElementId(sourceAspects[0].element.id);
|
|
1663
1586
|
// Transform source ElementMultiAspects into target ElementAspectProps
|
|
1664
|
-
const targetAspectPropsArray = sourceAspects.map((srcA) => this.onTransformElementAspect(srcA
|
|
1665
|
-
sourceAspects.forEach((a) =>
|
|
1587
|
+
const targetAspectPropsArray = sourceAspects.map((srcA) => this.onTransformElementAspect(srcA));
|
|
1588
|
+
sourceAspects.forEach((a) => {
|
|
1589
|
+
if (!this.doAllReferencesExistInTarget(a)) {
|
|
1590
|
+
this._partiallyCommittedAspectIds.add(a.id);
|
|
1591
|
+
}
|
|
1592
|
+
});
|
|
1666
1593
|
// const targetAspectsToImport = targetAspectPropsArray.filter((targetAspect, i) => hasEntityChanged(sourceAspects[i], targetAspect));
|
|
1667
1594
|
const targetIds = this.importer.importElementMultiAspects(targetAspectPropsArray, (a) => {
|
|
1668
1595
|
const isExternalSourceAspectFromTransformer = a instanceof core_backend_1.ExternalSourceAspect &&
|
|
@@ -1672,16 +1599,14 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1672
1599
|
});
|
|
1673
1600
|
for (let i = 0; i < targetIds.length; ++i) {
|
|
1674
1601
|
this.context.remapElementAspect(sourceAspects[i].id, targetIds[i]);
|
|
1675
|
-
this.resolvePendingReferences(sourceAspects[i]);
|
|
1676
1602
|
}
|
|
1677
1603
|
}
|
|
1678
1604
|
/** Transform the specified sourceElementAspect into ElementAspectProps for the target iModel.
|
|
1679
1605
|
* @param sourceElementAspect The ElementAspect from the source iModel to be transformed.
|
|
1680
|
-
* @param _targetElementId The ElementId of the target Element that will own the ElementAspects after transformation.
|
|
1681
1606
|
* @returns ElementAspectProps for the target iModel.
|
|
1682
1607
|
* @note A subclass can override this method to provide custom transform behavior.
|
|
1683
1608
|
*/
|
|
1684
|
-
onTransformElementAspect(sourceElementAspect
|
|
1609
|
+
onTransformElementAspect(sourceElementAspect) {
|
|
1685
1610
|
const targetElementAspectProps = this.context.cloneElementAspect(sourceElementAspect);
|
|
1686
1611
|
return targetElementAspectProps;
|
|
1687
1612
|
}
|
|
@@ -1805,6 +1730,8 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1805
1730
|
this.context.remapElement(sourceSubjectId, targetSubjectId);
|
|
1806
1731
|
await this.processChildElements(sourceSubjectId);
|
|
1807
1732
|
await this.processSubjectSubModels(sourceSubjectId);
|
|
1733
|
+
this.completePartiallyCommittedElements();
|
|
1734
|
+
this.completePartiallyCommittedAspects();
|
|
1808
1735
|
}
|
|
1809
1736
|
/**
|
|
1810
1737
|
* Initialize prerequisites of processing, you must initialize with an [[InitOptions]] if you
|
|
@@ -2126,7 +2053,9 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
2126
2053
|
else {
|
|
2127
2054
|
await this.exporter.exportModel(core_common_1.IModel.repositoryModelId);
|
|
2128
2055
|
}
|
|
2056
|
+
this.completePartiallyCommittedElements();
|
|
2129
2057
|
await this.exporter["exportAllAspects"](); // eslint-disable-line @typescript-eslint/dot-notation
|
|
2058
|
+
this.completePartiallyCommittedAspects();
|
|
2130
2059
|
await this.exporter.exportRelationships(core_backend_1.ElementRefersToElements.classFullName);
|
|
2131
2060
|
if (this._options.forceExternalSourceAspectProvenance &&
|
|
2132
2061
|
this.shouldDetectDeletes()) {
|
|
@@ -2165,6 +2094,8 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
2165
2094
|
async processChanges(options) {
|
|
2166
2095
|
// must wait for initialization of synchronization provenance data
|
|
2167
2096
|
await this.exporter.exportChanges(this.getExportInitOpts(options));
|
|
2097
|
+
this.completePartiallyCommittedElements();
|
|
2098
|
+
this.completePartiallyCommittedAspects();
|
|
2168
2099
|
if (this._options.optimizeGeometry)
|
|
2169
2100
|
this.importer.optimizeGeometry(this._options.optimizeGeometry);
|
|
2170
2101
|
this.importer.computeProjectExtents();
|