Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » question about "ATL/Tutorials - Create a simple ATL transformation"
question about "ATL/Tutorials - Create a simple ATL transformation" [message #850706] Fri, 20 April 2012 08:49
Luke Ji is currently offline Luke JiFriend
Messages: 1
Registered: April 2012
Junior Member
I am learning ATL. I tried to follow the tutorial "ATL/Tutorials - Create a simple ATL transformation" at wiki.eclipse.org/ATL/Tutorials_-_Create_a_simple_ATL_transformation

but the transformation does not work out. I got exactly the same results as described in

www.eclipse.org/forums/index.php/m/630233/

Upon close examination of the ecore files generated by Eclipse on my PC, I noticed that it is quite different from the text listed at the wiki tutorial page. Some of the differences are marked in red. I tried several versions of Eclipse and ATL SDK on my PC, and the files on my PC remain the same.

If I simply copy the files from wiki page to my PC and use them in the ATL project, the transformation could generate the same result as the wiki page.

Can anyone give an explanation for this and how I can generate the same files as on Wiki page?

Thanks in advance!



wiki file
--------------------------------------------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>
[color=red]<xmi:XMI xmi:version="2.0"
xmlns:xmi="//www.omg.org/XMI" xmlns:xsi="//www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="//www.eclipse.org/emf/2002/Ecore">[/color]

<ecore:EPackage name="Families">
<eClassifiers xsi:type="ecore:EClass" name="Family">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="lastName" ordered="false"
unique="false" lowerBound="1" eType="ecore:EDataType //www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="father" ordered="false"
lowerBound="1" eType="#/0/Member" containment="true" eOpposite="#/0/Member/familyFather"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="mother" ordered="false"
lowerBound="1" eType="#/0/Member" containment="true" eOpposite="#/0/Member/familyMother"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="sons" ordered="false"
upperBound="-1" eType="#/0/Member" containment="true" eOpposite="#/0/Member/familySon"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="daughters" ordered="false"
upperBound="-1" eType="#/0/Member" containment="true" eOpposite="#/0/Member/familyDaughter"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Member">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="firstName" ordered="false"
unique="false" lowerBound="1" eType="ecore:EDataType //www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="familyFather" ordered="false"
eType="#/0/Family" eOpposite="#/0/Family/father"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="familyMother" ordered="false"
eType="#/0/Family" eOpposite="#/0/Family/mother"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="familySon" ordered="false"
eType="#/0/Family" eOpposite="#/0/Family/sons"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="familyDaughter" ordered="false"
eType="#/0/Family" eOpposite="#/0/Family/daughters"/>
</eClassifiers>
</ecore:EPackage>
</xmi:XMI>



my file

--------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="//www.omg.org/XMI" xmlns:xsi="//www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="//www.eclipse.org/emf/2002/Ecore" name="Families">

<eClassifiers xsi:type="ecore:EClass" name="Family">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="lastName" lowerBound="1"
eType="ecore:EDataType //www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="father" lowerBound="1"
eType="#//Member" containment="true" eOpposite="#//Member/familyFather"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="mother" lowerBound="1"
eType="#//Member" containment="true" eOpposite="#//Member/familyMother"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="sons" upperBound="-1" eType="#//Member"
containment="true" eOpposite="#//Member/familySon"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="daughters" upperBound="-1"
eType="#//Member" containment="true" eOpposite="#//Member/familyDaughter"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Member">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="firstName" lowerBound="1"
eType="ecore:EDataType //www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="familyFather" eType="#//Family"
eOpposite="#//Family/father"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="familyMother" eType="#//Family"
eOpposite="#//Family/mother"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="familySon" eType="#//Family"
eOpposite="#//Family/sons"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="familyDaughter" eType="#//Family"
eOpposite="#//Family/daughters"/>
</eClassifiers>
</ecore:EPackage>

[Updated on: Fri, 20 April 2012 08:51]

Report message to a moderator

Previous Topic:[Solved][ATL] Inconsistencies between normal and programmatic execution mode
Next Topic:ATL from XMI files
Goto Forum:
  


Current Time: Fri Mar 29 10:31:40 GMT 2024

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

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

Back to the top