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 Gondal
Messages: 13
Registered: July 2009
Junior Member
Hi;

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 {

tf.name := sf.name;

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

--card.eAttributeType := eType;
card.lowerBound := f.Min;
card.upperBound := f.Max;
ec.eAttributes.add(card);
}
}
}

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
question:)

Any help would be great.

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


Current Time: Fri Oct 31 11:41:14 GMT 2014

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

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