openArchitectureWare.org

oAW has moved to Eclipse.

At this site you will find information about the outdated version openArchitectureWare 4, only.
Please read our letter of intent for further information.

 

 Forum Index > openArchitectureWare > openArchitectureWare 4.x Support New Topic Post Reply
 Problem with EEnumLiteral using multiple ecore models
 |  Printable Version
ekkehard gentz
 Monday, January 19 2009 @ 03:18 PM CET (Read 517 times)  
Forum Senior Member
Senior Member

Status: offline

Registered: 12/29/05
Posts: 351

today I run into a strange problem:

I'm using some ecore models (dynamic EMF):


<bean class="org.eclipse.mwe.emf.StandaloneSetup">
		<platformUri value=".." />
	    <registerEcoreFile value="${redview.meta.model.dir.uri}binding.ecore"/>
        <registerEcoreFile value="${redview.meta.model.dir.uri}datatypes.ecore"/>
        <registerEcoreFile value="${redview.meta.model.dir.uri}elements.ecore"/>
        <registerEcoreFile value="${redview.meta.model.dir.uri}layout.ecore"/>	
        <registerEcoreFile value="${redview.meta.model.dir.uri}styles.ecore"/>
        <registerEcoreFile value="${redview.meta.model.dir.uri}validation.ecore"/>
	</bean>


and in my XTend I import these models


import persist_eg;
import uml;

import ecore;
import binding;
import datatypes;
import elements;
import layout;
import styles;
import validation;


all worked well until I run in this scenario:


private Void setDefaultColorStyle4Base (styles::RStyle st) :
	st.setBgColor(datatypes::RColors::DEFAULT_BG) ->
	st.setFgColor(datatypes::RColors::DEFAULT_FG);


the editor was happy, but running the workflow I got


EvaluationException : The value of type 'class org.eclipse.emf.ecore.impl.EEnumLiteralImpl' must be of type 'org.eclipse.emf.ecore.impl.EEnumImpl


because EEnumLiterals work fine in other places I tried to find the reason.
and I found it Big Grin

its because the EEnumLiterals are in another ecore.
moving the EEnumLiterals from datatypes to styles all works well:


private Void setDefaultColorStyle4Base (styles::RStyle st) :
	st.setBgColor(styles::RColors::DEFAULT_BG) ->
	st.setFgColor(styles::RColors::DEFAULT_FG);


tried some more things and it was reproduceable: if the EEnumLiteral was in another ecore then the property I try to set with such a Literal,
I got an error

trying the same ecore models using EMF Model Editor causes no problems, I can set the Literals independent from location

is this a known bug ?

ekke


 
Profile Email Website
Quote
Patrick Schönbach
 Monday, January 19 2009 @ 08:18 PM CET  
Forum Senior Member
Senior Member

Status: offline

Registered: 11/03/07
Posts: 236

Would it be possible for you open a bug report and to provide us with a small, reproducable example, so we can reproduce your problem more quickly?


Regards, Patrick
 
Profile Email
Quote
ekkehard gentz
 Monday, January 19 2009 @ 08:49 PM CET  
Forum Senior Member
Senior Member

Status: offline

Registered: 12/29/05
Posts: 351

0f course I'll report a bug,
I only wanted to ask before if there are some hidden secrets to use EEnumLiterals from referenced ecore models
on Dynamic EMF world I'm not aware of Wink

always some work to reduce it to a small reproduceable scenario -
and you know, strange things always happen in complex worlflows

ekke


 
Profile Email Website
Quote
Content generated in: 0.05 seconds
New Topic Post Reply



 All times are CEST. The time is now 04:26 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content