[QVTO] Extending a transformation does not work together with disjuncts (bug?) [message #528104] |
Mon, 19 April 2010 11:16 |
Eclipse User |
|
|
|
Originally posted by: dhendriksREMOVE.THIS.REMOVE...THIStueDOTnlREMOVE..THIS
Hello all,
I have the following ecorecopy.qvto file (stripped down to make sure
this post doesn't get to big and unreadable):
<source>
modeltype mm_ecore "strict" uses 'http://www.eclipse.org/emf/2002/Ecore';
transformation ecorecopy(in inModel : mm_ecore, out outModel : mm_ecore);
main() {
inModel.rootObjects()[EPackage]->xmap transEPackage();
}
mapping EClass::transEClass() : EClass {
log('ecorecopy::EClass::transEClass()');
name := self.name;
}
mapping EClassifier::transEClassifier() : EClassifier
disjuncts
EClass::transEClass
{}
mapping EPackage::transEPackage() : EPackage {
log('ecorecopy::EPackage::transEPackage()');
eClassifiers := self.eClassifiers.xmap transEClassifier();
}
<endsource>
I also have ecorecopy_extended.qvto:
<source>
import ecorecopy;
modeltype mm_ecore "strict" uses 'http://www.eclipse.org/emf/2002/Ecore';
transformation ecorecopy_test(in inModel : mm_ecore, out outModel :
mm_ecore)
extends ecorecopy(in mm_ecore, out mm_ecore);
main() {
inModel.rootObjects()[EPackage]->xmap transEPackage();
}
mapping EPackage::transEPackage() : EPackage {
log('ecorecopy_extended::EPackage::transEPackage()');
eClassifiers := self.eClassifiers.xmap transEClassifier();
}
mapping EClass::transEClass() : EClass {
log('ecorecopy_extended::EClass::transEClass()');
name := self.name + 'TMP';
}
<endsource>
I run the ecorecopy_extended transformation on the following test ecore
file (this is the Emfatic version of the .ecore file):
<source>
@namespace(uri="http://parameters-1.0.0", prefix="params")
package parameters;
class Parameters {
val Parameter[*] parameters;
}
class Parameter {
attr String[1] name;
attr String[1] value;
}
<endsource>
I get this output on the console:
ecorecopy_extended::EPackage::transEPackage()
ecorecopy::EClass::transEClass()
ecorecopy::EClass::transEClass()
As expected, the transEPackage is from ecorecopy_extended. However, I
also included the transEClass in the extended version, and it should
have overwritten the one from ecorecopy, but it doesn't. My entire
transformation is much larger, but the core problems shows here. I
suspect it has something to with the disjuncts used in
EClassifier:transEClassifier. Maybe somehow it is resolved locally in
ecorecopy, instead of the extended ecorecopy_extended?
I think this is a bug. Can anybody confirm this?
Thanks in advance,
Dennis
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02113 seconds