[ETL/EOL][newbie] Dealing with EFeatureMapEntry? [message #467883] |
Mon, 03 August 2009 09:33 |
Eclipse User |
|
|
|
Originally posted by: d.clowes.lboro.ac.uk
Hello all,
I'm trying to transform data from a model based on an XSD to one based on
my own meta-model. I'm having difficult with EFeatureMapEntry and wondered
if anyone has any experience of transforming these relationships?
In more detail I have an element that contains 4 different sub-elements.
The order of these is important and I am assuming it is defined in the
EFeatureMapEntry relationship.
I have tried something like this:
for (x in v.element.group){
if(x.isTypeOf(XMLMetaModel!XMLElement){
var z := x.equivalent();
-- Do stuff for this type
}
if(x.isTypeOf(XMLMetaModel!XMLElement2){
var z := x.equivalent();
-- Do stuff for this type
}
}
However the if statements for the 4 element types are never entered. Is
there an operation for returning an elements type? i.e.
x.type().println(), or should this be approached another way?
Thanks, Darren
|
|
|
Re: [ETL/EOL][newbie] Dealing with EFeatureMapEntry? [message #467959 is a reply to message #467883] |
Mon, 03 August 2009 12:52 |
Louis Rose Messages: 440 Registered: July 2009 Location: York, United Kingdom |
Senior Member |
|
|
Hi Darren,
Darren Clowes wrote:
> Hello all,
>
> I'm trying to transform data from a model based on an XSD to one based
> on my own meta-model. I'm having difficult with EFeatureMapEntry and
> wondered if anyone has any experience of transforming these relationships?
IIRC, feature maps are used in place of derived features for
encapsulating complicated relationships, such as the one described here:
http://www.eclipse.org/modeling/emf/docs/overviews/FeatureMa p.pdf
If so, I think there's probably an easier way to achieve what you want.
I'm not sure what is that easier way, but the PDF above might be of some
help.
>
> In more detail I have an element that contains 4 different sub-elements.
> The order of these is important and I am assuming it is defined in the
> EFeatureMapEntry relationship.
>
> I have tried something like this:
>
> for (x in v.element.group){
> if(x.isTypeOf(XMLMetaModel!XMLElement){
> var z := x.equivalent();
> -- Do stuff for this type
> }
> if(x.isTypeOf(XMLMetaModel!XMLElement2){
> var z := x.equivalent();
> -- Do stuff for this type
> }
> }
>
> However the if statements for the 4 element types are never entered. Is
> there an operation for returning an elements type? i.e.
> x.type().println(), or should this be approached another way?
Is x an element of an EMF model? If so, try:
x.eClass().println()
Cheers,
Louis.
|
|
|
|
Re: [ETL/EOL][newbie] Dealing with EFeatureMapEntry? [message #572272 is a reply to message #467883] |
Mon, 03 August 2009 12:52 |
Louis Rose Messages: 440 Registered: July 2009 Location: York, United Kingdom |
Senior Member |
|
|
Hi Darren,
Darren Clowes wrote:
> Hello all,
>
> I'm trying to transform data from a model based on an XSD to one based
> on my own meta-model. I'm having difficult with EFeatureMapEntry and
> wondered if anyone has any experience of transforming these relationships?
IIRC, feature maps are used in place of derived features for
encapsulating complicated relationships, such as the one described here:
http://www.eclipse.org/modeling/emf/docs/overviews/FeatureMa p.pdf
If so, I think there's probably an easier way to achieve what you want.
I'm not sure what is that easier way, but the PDF above might be of some
help.
>
> In more detail I have an element that contains 4 different sub-elements.
> The order of these is important and I am assuming it is defined in the
> EFeatureMapEntry relationship.
>
> I have tried something like this:
>
> for (x in v.element.group){
> if(x.isTypeOf(XMLMetaModel!XMLElement){
> var z := x.equivalent();
> -- Do stuff for this type
> }
> if(x.isTypeOf(XMLMetaModel!XMLElement2){
> var z := x.equivalent();
> -- Do stuff for this type
> }
> }
>
> However the if statements for the 4 element types are never entered. Is
> there an operation for returning an elements type? i.e.
> x.type().println(), or should this be approached another way?
Is x an element of an EMF model? If so, try:
x.eClass().println()
Cheers,
Louis.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02899 seconds