-
Notifications
You must be signed in to change notification settings - Fork 2
Undo/Redo #3
Comments
Turns out this is a tad more complicated than I expected... 90% there... ;-) |
Yes!!! Undo/Redo implemented. There may be bugs so need to check multiple undo and redo actions... |
I've tested and it works so far... (waiting a bit before closing, just in case...) |
found a bug while testing edge case 1 :-(
Now, undo the model import: the relationship's ends changes are not rolled back Note: if before re-importing model B into A, there are some views containing the relationship (ie. views that are impacted by the relationship's end been restored), then after undo everything is ok. |
Can you summarise this in simple steps to create model A and B? |
Use these models: Test Merge.zip
|
OK. If you could check the logic of the code with me... In
It seems that calling |
It already changes the relationship when update is off (for this very specific edge case).
I'll check the code and see exactly what happens. This might take some time as I have to switch to another topic :-( |
I think the cause is in the main Archi code at
When a new View is imported the connections are made and then the underlying source and target concepts are re-assigned, Need to look at |
In ViewImporter the connections are not put on the undo/redo stack because they will be automatically removed on undo of creating or updating a new View. But...if |
Yes, this is the cause of the problem. Now working on a fix... |
Before I fix this, a question - are there any other possible scenarios where:
If there could be a chance of this happening then perhaps we should call |
I don't think so, this is really an edge case.
Exactly, this really should not happen, and when it happens (edge case) we really want to warn the user at the end. |
OK, thanks, I have a fix for it. I just need to refine it... |
...should be fixed now. |
I've started work on this in the "dev" branch.
Each import operation should be performed as an undoable command to be put on the command stack for the target model.
This means that we won't have to ask the user to save the model first and we can remove the temporary reset of the command stack.
This issue is just a placeholder to track any problems that might be found for Undo/Redo of the whole import operation.
The text was updated successfully, but these errors were encountered: