|
Re: ResourceSetListener : Command cancel issue [message #420935 is a reply to message #420885] |
Wed, 16 July 2008 18:19 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
--=-8kxW/66Y9joX9YID5ywD
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi, Alan,
Is the "cancelled command result" accomanied by an OK status or by some
kind of error status?
This might also be an incidence of a bug in which IUndoableOperations
used as triggers would never cause rollback:
https://bugs.eclipse.org/234868
HTH,
Christian
On Tue, 2008-07-15 at 17:03 +0100, Alan wrote:
> Hello all,
>
> I am using a number of ResourceSetListeners to send out notifications of
> changes to my model.
> The setup is as follows:
>
> 1) A command that send out notifications to listeners is returned in the
> transactionAboutToCommit method.
> 2) isAggregatePrecommitListener is set to true so only top level commits
> cause notifications
>
> An issue has arisen which is causing problems. A command is run during the
> drag and drop onto a GMF editor.
> During this command a dialog is shown to the user which allows them to
> cancel.
> If they do cancel a CommandResult.newCancelledCommandResult is returned.
> However the precommit still takes place and notifications are sent.
> Is this correct ?
>
> I tried a number of things:
> a) Changing RSL to just handle post-commits - no joy
> b) Seeing if command that sends notifications if rolled back (undone) - it
> wasn't
> c) explicitly getting a handle on the active transaction before I return
> cancel and aborting it - again no change.
>
> I added an OperationHistoryListener and I could see in this that
> OPERATION_NOT_OK is the event type.
> However I cannot see how I can use the OperationHistoryListener as it does
> not have the notifications I need as to what is changing.
>
> I get the feeling I am missing something so any help anyone can give would
> be greatly appreciated
>
>
> thanks,
> Alan.
>
>
>
--=-8kxW/66Y9joX9YID5ywD
Content-Type: text/html; charset=utf-8
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Alan,<BR>
<BR>
Is the "cancelled command result" accomanied by an OK status or by some kind of error status?<BR>
<BR>
This might also be an incidence of a bug in which IUndoableOperations used as triggers would never cause rollback:<BR>
<BR>
https://bugs.eclipse.org/234868<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
On Tue, 2008-07-15 at 17:03 +0100, Alan wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello all,</FONT>
<FONT COLOR="#000000">I am using a number of ResourceSetListeners to send out notifications of </FONT>
<FONT COLOR="#000000">changes to my model.</FONT>
<FONT COLOR="#000000">The setup is as follows:</FONT>
<FONT COLOR="#000000">1) A command that send out notifications to listeners is returned in the </FONT>
<FONT COLOR="#000000">transactionAboutToCommit method.</FONT>
<FONT COLOR="#000000">2) isAggregatePrecommitListener is set to true so only top level commits </FONT>
<FONT COLOR="#000000">cause notifications</FONT>
<FONT COLOR="#000000">An issue has arisen which is causing problems. A command is run during the </FONT>
<FONT COLOR="#000000">drag and drop onto a GMF editor.</FONT>
<FONT COLOR="#000000">During this command a dialog is shown to the user which allows them to </FONT>
<FONT COLOR="#000000">cancel.</FONT>
<FONT COLOR="#000000">If they do cancel a CommandResult.newCancelledCommandResult is returned.</FONT>
<FONT COLOR="#000000">However the precommit still takes place and notifications are sent.</FONT>
<FONT COLOR="#000000">Is this correct ?</FONT>
<FONT COLOR="#000000">I tried a number of things:</FONT>
<FONT COLOR="#000000">a) Changing RSL to just handle post-commits - no joy</FONT>
<FONT COLOR="#000000">b) Seeing if command that sends notifications if rolled back (undone) - it </FONT>
<FONT COLOR="#000000">wasn't</FONT>
<FONT COLOR="#000000">c) explicitly getting a handle on the active transaction before I return </FONT>
<FONT COLOR="#000000">cancel and aborting it - again no change.</FONT>
<FONT COLOR="#000000">I added an OperationHistoryListener and I could see in this that </FONT>
<FONT COLOR="#000000">OPERATION_NOT_OK is the event type.</FONT>
<FONT COLOR="#000000">However I cannot see how I can use the OperationHistoryListener as it does </FONT>
<FONT COLOR="#000000">not have the notifications I need as to what is changing.</FONT>
<FONT COLOR="#000000">I get the feeling I am missing something so any help anyone can give would </FONT>
<FONT COLOR="#000000">be greatly appreciated</FONT>
<FONT COLOR="#000000">thanks,</FONT>
<FONT COLOR="#000000">Alan.</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-8kxW/66Y9joX9YID5ywD--
|
|
|
Powered by
FUDForum. Page generated in 0.02507 seconds