Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Character keeps 'disappearing'
[ATL] Character keeps 'disappearing' [message #490877] Mon, 12 October 2009 04:07 Go to next message
Eclipse UserFriend
Hi,

I'm trying to perform an ATL transformation, where both the source and target meta model are the Ecore model. I'm trying it in tiny steps, so the first thing I'm trying now is to literally copy the source model into the target model. This works for EPackage, EClass, EAttribute, until we arrive at references. A reference is coded as:

<eStructuralFeatures xsi:type="ecore:EReference" name="ref1" eType="#//Class1"/>


and for some reason, the 'C' after the '#//' gets dropped, resulting in the following error:

Error loading platform:/resource/mergeTransTest/model/m3in.ecore: The feature 'lass1' is not a valid feature


I tried googleing for this, but to no avail. So I'm hoping someone here has any thought. For completeness sake, I'll post the entire source model, and ATL file.

Sourcemodel:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="m3in"
    nsURI="http://m3in/1.0" nsPrefix="m3in">
  <eClassifiers xsi:type="ecore:EClass" name="Class1">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="ID" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Class2">
    <eStructuralFeatures xsi:type="ecore:EReference" name="ref1" eType="#//Class1"/>
  </eClassifiers>
</ecore:EPackage>


Transformation:
-- @path Ecore=platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore

module merge;
create OUT : Ecore from IN : Ecore;

rule copyEPackage{
	from
		a : Ecore!EPackage
	to
		p : Ecore!EPackage(
			eClassifiers <- a.eClassifiers,
			name <- 'out',
			nsURI <- 'http://out/1.0',
			nsPrefix <- 'out'
		)
		
}

rule copyEClass{
	from
		a : Ecore!EClass
	to
		p : Ecore!EClass(
			name <- a.name,
			eStructuralFeatures <- a.eStructuralFeatures
		)
}

rule copyEAttribute{
	from
		a : Ecore!EAttribute
	to
		p : Ecore!EAttribute(
			name <- a.name,
			eType <- a.eType
		)
}

rule copyEReference{
	from
		a : Ecore!EReference
	to
		p : Ecore!EReference(
			name <- a.name,
			upperBound <- a.upperBound,
			lowerBound <- a.lowerBound,
			containment <- a.containment,
			eOpposite <- a.eOpposite
		)	
}

[Updated on: Mon, 12 October 2009 04:08] by Moderator

Re: [ATL] Character keeps 'disappearing' [message #502690 is a reply to message #490877] Wed, 09 December 2009 07:38 Go to previous messageGo to next message
Eclipse UserFriend
Does anyone have any ideas? I still can't get it to work Sad
Re: [ATL] Character keeps 'disappearing' [message #504114 is a reply to message #502690] Thu, 17 December 2009 05:43 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------030409000906010805010205
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

Sorry for the late answer.
When you use Ecore as metamodel, you have to mention in the launch
configuration that it is a metametamodel (using the ismetametamodel
checkbox near the Ecore metamodel declaration), in order to prevent
loading issues like yours which may happen if Ecore metamodel is loaded
several times.
The checkbox make ATL consider an unique instance of this Resource.

Best regards,

William

RJ a écrit :
> Does anyone have any ideas? I still can't get it to work :(

--
Ne manquez pas notre prochaine formation ATL inter entreprises:
ATL - Paris - du 2 au 3 Décembre 2009
Pour plus de dates et pour le détail de cette formation:
http://www.obeo.fr/pages/formations/fr

Don't forget our next ATL training:
ATL - Paris - 2009 December from 2th to 3th
More dates and training program on:
http://www.obeo.fr/pages/formations/fr

--------------030409000906010805010205
Content-Type: text/x-vcard; charset=utf-8;
name="william_piers.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="william_piers.vcf"

YmVnaW46dmNhcmQNCmZuOldpbGxpYW0gUGllcnMNCm46UGllcnM7V2lsbGlh bQ0Kb3JnOk9i
ZW8NCmFkcjoyIHJ1ZSBSb2JlcnQgU2NodW1hbm47O2xvdCAyNDtOQU5URVM7 OzQ0NDA4O0Zy
YW5jZQ0KZW1haWw7aW50ZXJuZXQ6d2lsbGlhbS5waWVyc0BvYmVvLmZyDQp0 aXRsZTpNREEg
Q29uc3VsdGFudA0KdGVsO3dvcms6KzMzICgwKTIgNTEgMTMgNTAgNTMNCnVy bDpodHRwOi8v
d3d3Lm9iZW8uZnINCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K
--------------030409000906010805010205--
Re: [ATL] Character keeps 'disappearing' [message #504197 is a reply to message #490877] Thu, 17 December 2009 11:14 Go to previous message
Eclipse UserFriend
Tnx Very Happy.
That was almost too easy...
Previous Topic:[QVT] How to process element/package imports to href models/libraries?
Next Topic:[ATL] e(Generic)SuperTypes
Goto Forum:
  


Current Time: Fri Jul 18 15:51:43 EDT 2025

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

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

Back to the top