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

Provide hook after transformer initializes to allow consumers to run some code. #180

Open nick4598 opened 1 month ago

nick4598 commented 1 month ago

Context

NOTE: Not urgent or blocking! There are already currently working workarounds in SVCs side for this. SVCs team has a function manualInitialize which is used mainly for: this._startChangesetIndex = this.synchronizationVersion.index + 1;.

We should support SVCs team desire to determine the startChangesetIndex so that they do not have to have a manualInitialize which has to set a private property _isSynchronization on the core transformer.

Potential Options

Maybe on red arrow could add? image image Or somewhere in this function above

Concerns

I raised a concern on the below PR that I think could be relevant. https://github.com/iTwin/imodel-transformer/pull/172

One other concern I have is, does the transformation services team ever setup the exporter manually before you call the transformer? Currently you'll need to add your custom changes before you call IModelTransformer.initialize(), which I personally ran into some trouble when trying to allow myself to do that in the tests (can look at timelinetestutil to see what changes I had to make to support that)

JulijaRamoskiene commented 1 month ago

Rplied to your question about exporter: https://github.com/iTwin/imodel-transformer/pull/172#issuecomment-2109510399

To answer your question about Exporter, yes, we do set up exporter manually. We have our custom Exporter: https://dev.azure.com/bentleycs/iModelTechnologies/_git/imodel-transformations?path=/packages/imodel-transformations-local/src/Exporter.ts Which is initialized and passed to transformer here: https://dev.azure.com/bentleycs/iModelTechnologies/_git/imodel-transformations?path=/packages/imodel-transformations-local/src/transformers/TransformerFactory.ts