Skip to main content



      Home
Home » Modeling » Epsilon » [EOL] Can we get an example on how to use the closure operation
[EOL] Can we get an example on how to use the closure operation [message #1397412] Wed, 09 July 2014 13:38 Go to next message
Eclipse UserFriend
I know it is porobably more of understanding the whole concept of transitive closures, but an example would help us (at least me) how does this work on Epislon.

Re: [EOL] Can we get an example on how to use the closure operation [message #1397467 is a reply to message #1397412] Wed, 09 July 2014 15:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi

There are examples in the OCL specification.

Regards

Ed Willink

On 09/07/2014 18:38, Horacio Hoyos wrote:
> I know it is porobably more of understanding the whole concept of
> transitive closures, but an example would help us (at least me) how
> does this work on Epislon.
>
>
Re: [EOL] Can we get an example on how to use the closure operation [message #1397535 is a reply to message #1397467] Wed, 09 July 2014 17:40 Go to previous messageGo to next message
Eclipse UserFriend
Hi Horacio,

Please find an example below:

for (c in EClass.all) {
c.closure(c|c.eSuperTypes).flatten().name.println();
// Same as c.eAllSuperTypes.name.println();
}

Cheers,
Dimitris
Re: [EOL] Can we get an example on how to use the closure operation [message #1397843 is a reply to message #1397535] Thu, 10 July 2014 04:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Is it the same?

The OCL closure() includes the source(s) and is invoked on a Collection.

Your example appears to be invoked on an Element, which eAllSuperTypes
excludes.

Regards

Ed Willink

On 09/07/2014 22:40, Dimitris Kolovos wrote:
> Hi Horacio,
>
> Please find an example below:
>
> for (c in EClass.all) {
> c.closure(c|c.eSuperTypes).flatten().name.println();
> // Same as c.eAllSuperTypes.name.println();
> }
>
> Cheers,
> Dimitris
Re: [EOL] Can we get an example on how to use the closure operation [message #1397962 is a reply to message #1397843] Thu, 10 July 2014 08:02 Go to previous message
Eclipse UserFriend
Hi Ed,

The semantics of "closure" in EOL is (intentionally) somewhat different to OCL. In EOL, "closure" can be invoked both on collections and model elements and the result excludes the object on which it is invoked.

Cheers,
Dimitris
Previous Topic:[EGL] [SOVLED]How to load plain XML file in Java code
Next Topic:[EOL] Accessing instances of the EOL Metamodel
Goto Forum:
  


Current Time: Mon Jul 14 18:59:15 EDT 2025

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

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

Back to the top