iTwin / imodel-transformer

API for exporting an iModel's parts and also importing them into another iModel
MIT License
3 stars 2 forks source link

Explicitly track provenance with ExternalSourceAspects when combining elements #50

Closed ViliusRuskys closed 1 year ago

ViliusRuskys commented 1 year ago

Added explicit tracking of combined elements by forcing ExternalSourceAspects to be used as provenance for those specific elements.

A bug still exists with Model deletions. Consider this scenario:

  1. We have 2 PhysicalModels with 10 physical Elements each.
  2. We combine the 2 Models with the initial transformation.
  3. We delete one of the models from the source iModel, which in turn deletes 10 of its elements.
  4. We run change processing workflow.
  5. The transformer tracks the provenance of the deleted model to the 'combined' model in the targetDb and deletes it, which in turn deletes all 20 Physical Elements.

Probably need to implement something similar like "doNotUpdateElementIds" for models as well.

MichaelBelousov commented 1 year ago

looks OK, I will take a second look Monday, and read the test more deeply

MichaelBelousov commented 1 year ago

@ViliusRuskys can you merge the conflicts and then I'll review?

MichaelBelousov commented 1 year ago

@ViliusRuskys can you merge the conflicts and then I'll review?

I merged the conflicts

MichaelBelousov commented 1 year ago

weird github is not reflecting the changes to origin/element-consolidation...

MichaelBelousov commented 1 year ago

closing and remaking this PR, sorry Vilius