Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Xtend - access the EnumLiterals - not possible(Xtend)
Xtend - access the EnumLiterals - not possible [message #947495] Wed, 17 October 2012 06:15 Go to next message
Dan Tololoi is currently offline Dan TololoiFriend
Messages: 33
Registered: September 2012
Location: Iasi, Romania
Member

Hello all,

I have this following issue into one file.ext that I created to generate some code out of the ecore.

String getString(Type type):
switch (type) {
case Type::Running : "Running_type"
case Type::Waiting : "Waiting_type"
default : "default"
};

Type is an Enum in my ecore and has the EnumLiterals Running and Waiting. I receive the error in the editor : Callable not found:Unknown variable, type or enumeration literal
'Type::Running'.

I have added also the check for the JavaBeansMetamodel to have it activated.
When I access this getString from the Xpand, it always takes the default case, meaning the evaluation was not done for Running or Waiting.

Maybe someone has a clue what else should I do or what should I change in the above syntax.
I add also that I don't want the getType to have it used, because I want to customize the text that I generate.

[Updated on: Wed, 17 October 2012 06:34]

Report message to a moderator

Re: Xtend - access the EnumLiterals - not possible [message #947525 is a reply to message #947495] Wed, 17 October 2012 06:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi i cannot reproduce this.
are you sure you did the imports right?



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtend - access the EnumLiterals - not possible [message #947549 is a reply to message #947525] Wed, 17 October 2012 07:20 Go to previous messageGo to next message
Dan Tololoi is currently offline Dan TololoiFriend
Messages: 33
Registered: September 2012
Location: Iasi, Romania
Member

Yes, the import is done OK, for other types it works and I also have a context help.
import machine;

and machine is the package name and also the ecore name
Re: Xtend - access the EnumLiterals - not possible [message #947565 is a reply to message #947549] Wed, 17 October 2012 07:39 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Can you share a complete example?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Problem installing Xpand
Next Topic:Problems running org.eclipse.acceleo:maven:3.2.1 in maven
Goto Forum:
  


Current Time: Tue Apr 23 13:10:08 GMT 2024

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

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

Back to the top