Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » how to give an Ecore DataType to an attribute
how to give an Ecore DataType to an attribute [message #570841] Tue, 14 July 2009 16:12
Ali Gondal is currently offline Ali GondalFriend
Messages: 13
Registered: July 2009
Junior Member

I want to transform a model to an ecore metamodel(EM), but I am having a
problem in giving Ecore EString type to an EAttribute.

Here is my simple rule:

rule testRule
transform sf : FM!FeatureModel
to tf : EM!EPackage { :=;

for(f in FM.allInstances)
var ec : new EM!EClass;;
if(f.isTypeOf(Feature) or f.isTypeOf(Group))
var card : new EM!EAttribute; := 'Cardinality';
--var eType : new EM!ETypeParameter; := 'EString';
--card.eType := eType;
card.eType := EString; -- this gives the error, even EM.EString doesnt

--card.eAttributeType := eType;
card.lowerBound := f.Min;
card.upperBound := f.Max;

I dont want to do it through the variable eType as I want to use Ecore's
built-in data type. I've just started using EMF/ETL and hence this basic

Any help would be great.

Previous Topic:can't generate file in another project
Next Topic:how to give an Ecore DataType to an attribute
Goto Forum:

Current Time: Sun Oct 04 05:06:48 GMT 2015

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

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