[ATL] Character keeps 'disappearing' [message #490877] |
Mon, 12 October 2009 08:07 |
RJ Messages: 19 Registered: October 2009 Location: Eindhoven, The Netherland... |
Junior Member |
|
|
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 08:08] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04157 seconds