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

Support 'custom' changes being added to exporter.sourceDbChanges #172

Open nick4598 opened 2 months ago

nick4598 commented 2 months ago

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

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)

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

nick4598 commented 1 week ago

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)

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

Thanks, I think you guys would run into the same problem I did with adding custom changes then where I had to call random transformer init functions. I changed it so that its no longer necessary and should hopefully be much easier for you guys to addcustomchanges right after you setup your exporter.

The only real change to this is it means customchanges will now be added before any changes from changesets as opposed to customchanges being added after changes from changesets. I could see it causing some strange behavior if a custom change and a change from a changeset occurred on the same element.