Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Live Validation: Undo, if constraint is violated
Live Validation: Undo, if constraint is violated [message #423896] Thu, 09 October 2008 10:15 Go to next message
Bernd Mühlböck is currently offline Bernd MühlböckFriend
Messages: 46
Registered: July 2009
Member
How can I undo the last action (e.g. add an element) if a live
constraint is violated. I am using OCL constraints defined in the
plugin.xml.

Thanks,
Bernd
Re: Live Validation: Undo, if constraint is violated [message #423899 is a reply to message #423896] Thu, 09 October 2008 10:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Bernd,

The transaction APIs support the notion of rollback. So typically a
constraint would be checked after a set of changes, and if the
constraints are violated, the entire set of changes is rolled back to
the preceding valid state.


Bernd Mühlböck wrote:
> How can I undo the last action (e.g. add an element) if a live
> constraint is violated. I am using OCL constraints defined in the
> plugin.xml.
>
> Thanks,
> Bernd


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Live Validation: Undo, if constraint is violated [message #424325 is a reply to message #423899] Thu, 23 October 2008 02:08 Go to previous messageGo to next message
Bernd Mühlböck is currently offline Bernd MühlböckFriend
Messages: 46
Registered: July 2009
Member
It should just undo the last operation. That would be enough for me.
Maybe there is a way to use the OperationHistory.


Cheers,
Bernd


Ed Merks wrote:
> Bernd,
>
> The transaction APIs support the notion of rollback. So typically a
> constraint would be checked after a set of changes, and if the
> constraints are violated, the entire set of changes is rolled back to
> the preceding valid state.
>
>
> Bernd Mühlböck wrote:
>> How can I undo the last action (e.g. add an element) if a live
>> constraint is violated. I am using OCL constraints defined in the
>> plugin.xml.
>>
>> Thanks,
>> Bernd
Re: Live Validation: Undo, if constraint is violated [message #424331 is a reply to message #424325] Thu, 23 October 2008 11:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Bernd,

An operation is one or more changes. The notation
rollback-if-constraints-are-violated is exactly what the transaction
APIs support.


Bernd Mühlböck wrote:
> It should just undo the last operation. That would be enough for me.
> Maybe there is a way to use the OperationHistory.
>
>
> Cheers,
> Bernd
>
>
> Ed Merks wrote:
>> Bernd,
>>
>> The transaction APIs support the notion of rollback. So typically a
>> constraint would be checked after a set of changes, and if the
>> constraints are violated, the entire set of changes is rolled back to
>> the preceding valid state.
>>
>>
>> Bernd Mühlböck wrote:
>>> How can I undo the last action (e.g. add an element) if a live
>>> constraint is violated. I am using OCL constraints defined in the
>>> plugin.xml.
>>>
>>> Thanks,
>>> Bernd


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] CDO Duplicate ID problem with multiple getResource() calls in the same transaction
Next Topic:UML and UnlimitedNatural
Goto Forum:
  


Current Time: Fri Apr 26 08:01:46 GMT 2024

Powered by FUDForum. Page generated in 0.03314 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top