View Issue Details

IDProjectCategoryView StatusLast Update
0029884CommunityOCCT:Application Frameworkpublic2020-05-08 18:31
ReporterVico Liang Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionno change required 
Target Version7.5.0 
Summary0029884: Application Framework - Calling sequence of BeforeUndo() and AfterUndo() unpredictable
DescriptionUndo/redo delta sequence is base on label tree hierarchy. Base on this assumption, attributes may be designed with dependency with each other. The predict behavior is that BeforeUndo() and AfterUndo() will be called in the label tree hierarchy order. Actually, the order is unpredictable. The reason is TDF_Data::FixOrder() adjusted the delta order to fix another bug 0029142. It seems ugly and unnatural with such order fix.

TagsNo tags attached.
Test case number

Relationships

related to 0029142 closedbugmaster Open CASCADE Exception on Redo 

Activities

Vico Liang

2018-06-20 11:14

developer   ~0076843

Last edited: 2018-06-20 11:15

My use case looks like this, the application is base on TObj package, TObj_TObject rely on AfterUndo() to recover object from death and My_AISPresentation rely on BeforeUndo() and AfterUndo() to do presentation update. My_AISPresentation is designed to depend on TObj_TObject. It will crash during presentation updating on undo/redo because AfterUndo() of TObj_TObject is not called before My_AISPresentation.

mpv

2020-04-22 10:47

developer   ~0091712

  Dear Vico,

For such purpose, the BeforeUndo and AfterUndo methods return boolean values. If My_AISPresentation returns false, it will be called once again after TObj_TObject methods are called.

To simplify implementation you may return false and do nothing in My_AISPresentation::BeforeUndo and My_AISPresentation::AfterUndo while forceIt argument is false. If it is true, perform the needed action (using the dependency on TObj_TObject) and then return true.

Sorry for late response. Does this note help you?

Vico Liang

2020-05-08 15:06

developer   ~0092012

Dear mpv,

Thanks for your response and help. I think it should work in my case.My simple dependancy can be corrected in this way.

I would be better if the calling sequence BeforeUndo() and AfterUndo() obey the label tree structure.This rule is very useful in most situation during design application structure.It's a little tricky as you way during design application framework.I like a more general way.

mpv

2020-05-08 15:38

developer   ~0092013

  Dear Vico,

I would disagree that order related to the labels structure is flexible and suitable enough for all cases. Depended objects may be located in any way: lower or upper in the tree or in a flat list of children. So, any approach here could not help everybody.

But the current approach allows to keep dependency and the order of execution of undo/redo actions in any needed way and well-corresponds to the object-oriented approach.

So, I'm closing this issue.

mpv

2020-05-08 15:39

developer   ~0092014

Dear bugmaster, please close this issue. Fix is not needed.

Issue History

Date Modified Username Field Change
2018-06-20 10:56 Vico Liang New Issue
2018-06-20 10:56 Vico Liang Assigned To => mpv
2018-06-20 11:08 Vico Liang Relationship added related to 0029142
2018-06-20 11:14 Vico Liang Note Added: 0076843
2018-06-20 11:15 Vico Liang Note Edited: 0076843
2019-07-10 09:01 abv Target Version 7.4.0 => 7.5.0
2020-04-22 10:47 mpv Note Added: 0091712
2020-04-22 10:47 mpv Assigned To mpv => Vico Liang
2020-04-22 10:47 mpv Status new => feedback
2020-05-08 00:14 kgv Summary Calling sequence of BeforeUndo() and AfterUndo() unpredictable => Application Framework - Calling sequence of BeforeUndo() and AfterUndo() unpredictable
2020-05-08 15:06 Vico Liang Note Added: 0092012
2020-05-08 15:16 Vico Liang Assigned To Vico Liang => mpv
2020-05-08 15:38 mpv Note Added: 0092013
2020-05-08 15:38 mpv Status feedback => resolved
2020-05-08 15:39 mpv Note Added: 0092014
2020-05-08 15:39 mpv Assigned To mpv => bugmaster
2020-05-08 15:39 mpv Status resolved => reviewed
2020-05-08 18:31 bugmaster Status reviewed => closed
2020-05-08 18:31 bugmaster Resolution open => no change required