Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to set Enum value in custom edapt migration(How to set Enum value in custom edapt migration)
How to set Enum value in custom edapt migration [message #1814427] Wed, 11 September 2019 10:09 Go to next message
Arun Kumar is currently offline Arun KumarFriend
Messages: 14
Registered: January 2016
Junior Member
I am new to this edapt custom migration ,

As part of edapt migration of my.ecore, I have added extra two fields in the ecore which points to enum datatype.

Instance cls1=model.createInstance("myModel.class1");
cls1.set("messageMode", "IN")  --> tried to set as String, not working
cls1.set("messageMode", EnumLiteral.value("IN") --> error
cls1.set("messageMode",MessageModeEnumClass.IN) --? Not working.


How to set the enum value on particular attribute,. I have to get Enum literal but, how do i form from the class name of enum

I got struck on this point.please help me out
Re: How to set Enum value in custom edapt migration [message #1814798 is a reply to message #1814427] Wed, 18 September 2019 14:17 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 9
Registered: January 2017
Junior Member
Hi,

sorry for the delayed reply. I am not sure I understand question correctly. Could you please provide a full example including screenshots.

Best regards,
Maximilian



--
get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/

[Updated on: Wed, 18 September 2019 14:17]

Report message to a moderator

Re: How to set Enum value in custom edapt migration [message #1816111 is a reply to message #1814798] Mon, 21 October 2019 11:52 Go to previous message
Arun Kumar is currently offline Arun KumarFriend
Messages: 14
Registered: January 2016
Junior Member
Maximillian,

I was looking out for this code,
EEnum eEnum = metamodel.getEEnum(""myModel.MessageType");
EEnumLiteral eEnumLiteral = eEnum.getEEnumLiteral("EnumName");,

I somehow found out in google I guess. Thanks for your response !!
Previous Topic:[EMF Forms] Enum Dropdown: Value not set on keyboard input if Enter is not pressed
Next Topic:EMFForms: selecting different viewmodels programatically
Goto Forum:
  


Current Time: Sun Jul 12 20:12:34 GMT 2020

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

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

Back to the top