API to allow an Element to be moved across models
imodel-native: https://github.com/iTwin/imodel-native/pull/1300
Fixes: https://github.com/iTwin/itwinjs-backlog/issues/1481
I'd like to understand the use case for this. Who is asking and why? Moving an element between models is disallowed for good reasons. It also doesn't seem right to have this magically apply to assemblies.
I'd like to understand the use case for this. Who is asking and why? Moving an element between models is disallowed for good reasons. It also doesn't seem right to have this magically apply to assemblies.
Diego has mentioned it on the work item for this PR https://github.com/iTwin/itwinjs-backlog/issues/1481.
Diego has mentioned it on the work item for this PR https://github.com/iTwin/itwinjs-backlog/issues/1481.
I don't have access to the issues. Can you please explain it? Which Diego?
Diego has mentioned it on the work item for this PR iTwin/itwinjs-backlog#1481.
I don't have access to the issues. Can you please explain it? Which Diego?
Right sorry, I should've been more specific. @diegoalexdiaz has mentioned on the work item that this change is for domain-specific authoring apps which know how to handle data in their own channels safely.
I spoke to @diegoalexdiaz about this. Please talk to him about how to proceed.
As per the recent discussion on the BWG call, the API needs be a bulk move which changes the model of the child elements as well to avoid relaxing the parent-child must be in the same model rule. Also, an idea of exploring this as a possible use case for the requested re-design of the editing api was floated. This is to ensure the change is atomic and can be rolled back on any failures that occur midway. However, this PR contains the alternate approach which checks if any unsaved changes exist beforehand to then allow a rollback if the API throws an error. This PR contains extensive tests as well which are covering all the requirements mentioned. However, since there are still discussions to be had, and the requirements might change, I am closing this PR for now. Will reopen and update once the requirements and approach are concrete.