Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EGL] How to access to enums of a model
[EGL] How to access to enums of a model [message #989233] Wed, 05 December 2012 10:15 Go to next message
Lili R is currently offline Lili RFriend
Messages: 15
Registered: April 2012
Junior Member
Hello everybody!
I am new with EGL and I want to do a model-to-text transformation (model in EMF to text). But I have the follow issue.
I have some enums and I don't know how to access to them in the ELG file and I want to show in the text generated which are the enums that the user uses in her model.
I read in the Epsilon book (ELG section), that in the dynamic sections you can use EOL code. And I saw that EOL provides the # operator to access enumerations literal. Furthermore, I used the isDefined operation (for any type).But that I realize is the this operation gives us if the object is defined in the metamodel, and that I need is if the object is defined or used in the model.
Thanks in advance!
Lili
Re: [EGL] How to access to enums of a model [message #989278 is a reply to message #989233] Wed, 05 December 2012 13:46 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Lili,

Could you perhaps provide a minimal EGL example [1] demonstrating what you're trying to do?

Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: [EGL] How to access to enums of a model [message #989306 is a reply to message #989278] Wed, 05 December 2012 15:22 Go to previous messageGo to next message
Lili R is currently offline Lili RFriend
Messages: 15
Registered: April 2012
Junior Member
Oh! sorry. I attach a minimal example. Thanks in advance!
Regards,
Lili
Re: [EGL] How to access to enums of a model [message #989380 is a reply to message #989306] Wed, 05 December 2012 22:42 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi,

Unfortunately, I'm not able to load the default.inno model provided. The model reads

<?xml version="1.0" encoding="UTF-8"?>
<INNO xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="INNO">
<leadership>
<protagonist protagonist="TMT"/>
<ceo>
<pepe/>
<pepe ceoFactor="opennessToExperience"/>
<pepe ceoFactor="originality"/>
</ceo>
</leadership>
</INNO>

but there doesn't seem to be any class/feature named "pepe" in the metamodel. Any thoughts?

Cheers,
Dimitris
Re: [EGL] How to access to enums of a model [message #989459 is a reply to message #989380] Thu, 06 December 2012 10:12 Go to previous messageGo to next message
Lili R is currently offline Lili RFriend
Messages: 15
Registered: April 2012
Junior Member
Hi,
Yes it is my fault Sad Could you update the model with this other? Sorry for the inconveniences.
  • Attachment: default.inno
    (Size: 0.33KB, Downloaded 287 times)
Re: [EGL] How to access to enums of a model [message #989607 is a reply to message #989459] Thu, 06 December 2012 22:43 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi,

The following seems to be doing the trick:

---
DETERMINANTS OF INNOVATION:

[% for (leader in Leadership) { %] [%= Leadership.name %]

The protagonist of the innovation is: [%=leader.protagonist.protagonist %]
Factors that influence in the leaders' ability and motivation to innovate:

[%for (factor in leader.ceo.ceoFactor) { %]
[%=factor.ceoFactor%]
[%}%]

[%}%]
---

Cheers,
Dimitris
Re: [EGL] How to access to enums of a model [message #989657 is a reply to message #989607] Fri, 07 December 2012 08:30 Go to previous message
Lili R is currently offline Lili RFriend
Messages: 15
Registered: April 2012
Junior Member
Hi,
Thank you so much!
Regards,
Lili
Previous Topic:[Eugenia] Defining icon as link decoration
Next Topic:Cross reference problem with ETL
Goto Forum:
  


Current Time: Wed Apr 24 19:32:47 GMT 2024

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

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

Back to the top