Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Extending a transformation does not work together with disjuncts (bug?)
[QVTO] Extending a transformation does not work together with disjuncts (bug?) [message #528104] Mon, 19 April 2010 11:16 Go to next message
Eclipse UserFriend
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
Re: [QVTO] Extending a transformation does not work together with disjuncts (bug?) [message #528207 is a reply to message #528104] Mon, 19 April 2010 16:58 Go to previous messageGo to next message
PBarendrecht is currently offline PBarendrechtFriend
Messages: 36
Registered: November 2009
Location: Eindhoven, Netherlands
Member
Hi Dennis,

Hmm, sounds like a bug indeed (Bugzilla). You could try to add some pre-conditions to the transEClass() mapping (using the when-clause), maybe you can force something with it?

By the way, on the forums you can use the [ CODE ] and [ /CODE ] tags around your source code. That way the structure of your post is clearer (at least when viewing them with a browser at http:// www.eclipse.org/forums/index.php?t=thread&frm_id=23&).
Re: [QVTO] Extending a transformation does not work together with disjuncts (bug?) [message #528314 is a reply to message #528207] Tue, 20 April 2010 07:13 Go to previous message
Eclipse UserFriend
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl

Created bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=309762

Dennis


PBarendrecht wrote:
> Hi Dennis,
>
> Hmm, sounds like a bug indeed (Bugzilla). You could try to add some
> pre-conditions to the transEClass() mapping (using the when-clause),
> maybe you can force something with it?
>
> By the way, on the forums you can use the [ CODE ] and [ /CODE ] tags
> around your source code. That way the structure of your post is clearer
> (at least when viewing them with a browser at
> http://www.eclipse.org/forums/index.php?t=thread&frm_id= 23&).
Previous Topic:[QVTO] modeltype with platform URI doesn't work, but with namespace URI does
Next Topic:[ATL] Load ressources in UML model
Goto Forum:
  


Current Time: Fri Apr 19 07:09:22 GMT 2024

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

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

Back to the top