Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Recalling an invariant from an another invariant in OCLinEcore
Recalling an invariant from an another invariant in OCLinEcore [message #1294266] Sun, 13 April 2014 09:42 Go to next message
Emre T is currently offline Emre TFriend
Messages: 119
Registered: April 2013
Senior Member
Hello,

is it possible to recall an in the same class declared invariant in another invariant? An example would look like this:

invariant XYZ: -- something something --
invariant Choice: self.booleanValue = true implies "XYZ"

I know I actually can copy paste the entire invariant, but I would have really preferred such an option.

Thanks!

Emre
Re: Recalling an invariant from an another invariant in OCLinEcore [message #1294414 is a reply to message #1294266] Sun, 13 April 2014 12:37 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

No.

You can avoid cut and paste by defining the re-useable functionality as
a property or operation.

def: XYZ : Boolean = ....

(Since you can do that, there is case for a language extension that
allows invariant names to be accessed as a variable. ... implies XYZ.)

Regards

Ed Willink


On 13/04/2014 10:42, Emre T wrote:
> Hello,
>
> is it possible to recall an in the same class declared invariant in
> another invariant? An example would look like this:
>
> invariant XYZ: -- something something --
> invariant Choice: self.booleanValue = true implies "XYZ"
>
> I know I actually can copy paste the entire invariant, but I would
> have really preferred such an option.
>
> Thanks!
>
> Emre
Previous Topic:Problem with OCL
Next Topic:OCL expression updates
Goto Forum:
  


Current Time: Tue Mar 19 09:04:14 GMT 2024

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

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

Back to the top