Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Emfatic] Assign attribute in inheritance
[Emfatic] Assign attribute in inheritance [message #1251036] Wed, 19 February 2014 16:26 Go to next message
Brian Tost is currently offline Brian Tost
Messages: 4
Registered: April 2013
Junior Member
I have an emfatic file with textual notation from a metamodel:

class Element {
  attr int[1] min;
  attr int[1] max;
}

class SubElement extends Element {
}


I want that the class SubElement automatically assign a value to the variable min and max in the emfatic file.

I've tried:

class SubElement extends Element {
    min = 0;
    max = 1;
}


And this:

class SubElement extends Element {
    Element.min = 0;
    Element.max = 1;
}


Or:

class SubElement extends Element { 
    super.min = 0; super.max = 1; 
}


But without success. How can I fix this?
Re: [Emfatic] Assign attribute in inheritance [message #1251334 is a reply to message #1251036] Thu, 20 February 2014 00:21 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25919
Registered: July 2009
Senior Member
Fabio,

Better to ask about Emfatic on the eclipse.epsilon forum. I doubt what
you're showing can work because Ecore itself doesn't allow you to
override feature defaults in a derived class.

On 19/02/2014 10:26 PM, fabio soares wrote:
> I have an emfatic file with textual notation from a metamodel:
>
> class Element {
> attr int[1] min;
> attr int[1] max;
> }
>
> class SubElement extends Element {
> }
>
> I want that the class SubElement automatically assign a value to the
> variable min and max in the emfatic file.
>
> I've tried:
>
> class SubElement extends Element {
> min = 0;
> max = 1;
> }
>
> And this:
>
> class SubElement extends Element {
> Element.min = 0;
> Element.max = 1;
> }
>
> Or:
> class SubElement extends Element { super.min = 0; super.max = 1; }
>
> But without success. How can I fix this?
Previous Topic:[Teneo] How to get the audit history of a deleted entity?
Next Topic:TENEO LONGTEXT DATATYPE
Goto Forum:
  


Current Time: Sat Jul 26 15:25:54 EDT 2014

Powered by FUDForum. Page generated in 0.08136 seconds