File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
bulk-model-sync-lib/src/commonMain/kotlin/org/modelix/model/sync/bulk Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -185,8 +185,10 @@ class ModelImporter(
185
185
.forEach { (newChild, expected) ->
186
186
val expectedId = expected.originalId()
187
187
checkNotNull(expectedId) { " Specified node '$expected ' has no ID." }
188
- newChild.setPropertyValue(NodeData .idPropertyKey, expectedId)
189
- originalIdToExisting[expectedId] = newChild.reference
188
+ if (newChild.originalId() == null ) {
189
+ newChild.setPropertyValue(NodeData .ID_PROPERTY_KEY , expectedId)
190
+ }
191
+ originalIdToExisting[newChild.originalId() ? : expectedId] = newChild.reference
190
192
syncNode(newChild, expected, progressReporter)
191
193
}
192
194
continue
@@ -224,7 +226,9 @@ class ModelImporter(
224
226
val existingNodeReference = originalIdToExisting[expectedId]
225
227
if (existingNodeReference == null ) {
226
228
val newChild = existingParent.addNewChild(role, newIndex, expectedConcept)
227
- newChild.setPropertyValue(NodeData .idPropertyKey, expectedId)
229
+ if (newChild.originalId() == null ) {
230
+ newChild.setPropertyValue(NodeData .idPropertyKey, expectedId)
231
+ }
228
232
originalIdToExisting[expectedId] = newChild.reference
229
233
newChild
230
234
} else {
You can’t perform that action at this time.
0 commit comments