Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 17:38 Go to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 240
Registered: October 2009
Location: Mexico
Senior Member

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.



Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
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 19:25 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 21:40 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

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 08:25 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 12:02 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

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: Fri Mar 29 14:35:33 GMT 2024

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

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

Back to the top