This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 77785 - Undo feature works incorrect when invoked from Designer
Summary: Undo feature works incorrect when invoked from Designer
Status: VERIFIED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: BPEL (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Denis Anisimov
URL:
Keywords:
: 79620 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-13 10:38 UTC by Mikhail Kondratyev
Modified: 2006-08-04 08:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kondratyev 2006-06-13 10:38:55 UTC
Steps to reproduce:
 - create a new BPEL module
 - open BPEL in designer 
 - switch to source
 - add one more <empty/> tag
 - switch back to designer
 - press Ctrl+Z
The tag will be removed from source but not from the diagram. The diagram and
source will be out of sync.
Comment 1 Denis Anisimov 2006-06-22 12:49:09 UTC
It seems this is the problem that I discovered in other steps.
Original could be:
<reply/>
<receive/>

then one add empty:
<reply/>
<empty/>
<receive/>

sync ( go to designer f.e. )

remove via source "empty" back :

<reply/>
<receive/>

sync.
You will get one more "receive".
I'm sure that this is the same problem. This is XML team bug. I will 
monitor its state.
Comment 2 Denis Anisimov 2006-07-13 11:28:52 UTC
*** Issue 79620 has been marked as a duplicate of this issue. ***
Comment 3 Nam Nguyen 2006-07-21 22:36:26 UTC
Denis,
In the debugger I can see that XDMModel did fire the delete/add events during
undo/redo.  Somehow BpelModelImp.XDMListener (override xdm/xam XDMListener)
never receive the events, maybe it wasn't listening.  Since BpelModelImpl
override sync and transaction support, I am not sure this issue should be in
xml/xdm,xam?  Could you please analyse further in your code and tell us what
went wrong, if any, in xdm?  Please reevaluate and reassign properly.
Comment 4 Denis Anisimov 2006-07-24 08:23:22 UTC
Nam, I don't know , may be there exist my problems also , but I see behavior 
that is strange in XAM/XDM. Let me describe other way for reproduce this bug 
and what I see from my point of view.

Simple description:
1) create BPEL module.
2) go to source
3) remove <empty> element.
4) go to designer and perfroem "undo".
As result - source is correct , but diagram is not updated.

So what happened from my view:

you are right that I have my own XDMListener. But it just additional listener
that is not override behavior of XDMListener that used in XDMModel for handling
merge events. This listener I connect to model access only in sync - you are 
right also here . So I didn't get any events in this listener while undo.
BUT I don't need this listener at all for getting events about OM elements
added/deleted. Because if I correctly understand SyncUpdater should call
corresponding method "update" with correct parent and child.
Is it true ?
I belive this is true.
But such method is not called.
Moreover XDMListener that is implemented inside XDM should call at lest method
"fireComponentChangedEvent" of AbstractModel class. But I see that this method
is not called.

Method "sync" is overriden. But as I understand it is not called in "undo" 
action. "undo" method is also overriden but it call "super.undo" and all 
work that is performed inside "super undo" should be done independently from my
code. As I already said at least method "fireComponentChangedEvent" should be
called. 

I will add my XDMListener while "undo" working and check "merge event" 
appearance here. I will report later about it.
Comment 5 Denis Anisimov 2006-07-24 16:03:00 UTC
I'm sorry. That's my fault.
There was not started update at all when "sync" is performed.
In method "undoableEditHappened()"  of OM impl there was incorrect check for
"inSync" flag. There should be check for "inUndoRedo" flag.
If it is not set then we need to start update ( call to "beginUpdate()" method
of UndableEditSupport ).
Comment 6 Mikhail Kondratyev 2006-08-04 08:40:29 UTC
Verified in build 17