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

[Long Term] when transforming WIP to Shared, allow users to opt into transforming ViewDefinitions from WIP ViewStores to Shared ViewStores #162

Open nick4598 opened 3 months ago

nick4598 commented 3 months ago

Context

When an iModel is transformed, a decision must also be made about how to transform the data in all of its containers. One such type of container is a ViewStore Container

ViewStores are designed in such a way that they can be reused across iModels. You can read the documentation for ViewStore above, but in short elementIds are remapped to GUIDs when defining a View. From the documentation:

This allows the ViewStore to be used with more than one iModel, provided that the same Guids are used in each iModel.

When transforming an iModel from WIP to Shared, a user should be able to also opt in to transforming the WIP IModel's ViewStore into a Shared ViewStore. From Sam Wilson:

the shared views stored in the WIP iModel’s ViewStore could be copied to the ViewStore for the shared iModel. The view definitions should be portable. Whether the user wants to promote the viewdefintiions from WIP to shared is a different question. WIP and shared should not use the same ViewStore. WIP view definitions are WIP.

Open Questions

1) Personally I'm a bit unclear on how the conversion from elementId to GUID is determined and how it will work across iModels. One such way I can see this working is if the federationGuids across iModels are the same then they would be remapped to the same GUID.

1) When transforming an iModel from WIP to Shared, will the transformer be guaranteed to have an already present ViewStore associated with the shared iModel? The transformer would then take the responsibility of merging / porting over ViewDefinitions to the shared ViewStore from the WIP ViewStore if they opted in?

1) We're still waiting to hear back about the general priority of this item, but right now we are assuming its for post-june.

From Diego P.

If we do find that users care about copying view data, we will need to do some work to get that going, but should be possible given that a map of federation guids is maintained in the view store. Let me know if that's something that my team should look into for June.

The above seems to imply that the transformer would not be responsible for this, but maybe it requires further discussion with Diego and his team to truly figure that part out.

From Mark Halliwell about whether to copy saved views from wip to shared:

I wouldn’t think so. That could lead to a fairly messy workflow as well. The Saved View context in the WIP iModel may not be entirely reproduceable in the Shared iModel depending on what elements are being copied. You’d basically have a camera vector and some subset of elements to show.