Hello,
the problem is not with the extraction, but the atl model (.ecore) is
not complete.
First it misses a name for the two "ocl:Model" elements at the end of
the transformation. This is the name that appears in the CREATE part:
<ocl:OclModel model="/0/@inModels.0" name="first name"/>
<ocl:OclModel model="/0/@outModels.0" name"second name"/>
create OUT: <the first name comes here> from IN: <the second
here> ;
Second, there is no type in the inPattern and outPattern elements.
To illustrate this, I generated an ATL file using the latest versions
of ATL and AM3 from the CVS, and I got the transformation below.
rule {
from
Agrupacion : there is no type
to
Vista : there is no type
}
According to the ATL metamodel, a "SimpleOutPatternElement" inherits
from "VariableDeclaration", that must have a type
So, the .ecore should have something similar to the bold part below,
for every in and out patterns:
<outPattern>
<elements xsi:type="atl:SimpleOutPatternElement"
varName="Vista" id="Vista">
<type xsi:type="ocl:OclModelElement"
name="TypeName" model="/5"/>
</elements>
</outPattern>
<ocl:OclModel model="/0/@inModels.0" name ="abc"/>
<ocl:OclModelElement name="TypeName" model="/1"/>
If you are using the HOT from the KeysToNested example, you can
send and excerpt of the input weaving model. It is probably missing
some attributes.
Regards,
Marcos.
Kelly Garces wrote:
Hi,
I have problem extracted ATL file, I use AM3 version 1.0.0 with eclipse
3.1.1
I attach .ecore conform MMATL and .atl
Thanks for your help,
module ModelTrans;
create OUT :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:atl="http://www.eclipse.org/gmt/2005/ATL" xmlns:ocl="http://www.eclipse.org/gmt/2005/OCL">
<atl:Module name="ModelTrans">
<inModels metamodel="/1" name="IN"/>
<outModels metamodel="/2" name="OUT"/>
<elements xsi:type="atl:MatchedRule">
<outPattern>
<elements xsi:type="atl:SimpleOutPatternElement" varName="Vista" id="Vista"/>
</outPattern>
<inPattern>
<elements xsi:type="atl:SimpleInPatternElement" varName="Agrupacion" id="Agrupacion"/>
</inPattern>
</elements>
<elements xsi:type="atl:MatchedRule">
<outPattern>
<elements xsi:type="atl:SimpleOutPatternElement" varName="Vista" id="Vista"/>
</outPattern>
<inPattern>
<elements xsi:type="atl:SimpleInPatternElement" varName="Elemento" id="Elemento"/>
</inPattern>
</elements>
<elements xsi:type="atl:MatchedRule">
<outPattern>
<elements xsi:type="atl:SimpleOutPatternElement" varName="Vista" id="Vista"/>
</outPattern>
<inPattern>
<elements xsi:type="atl:SimpleInPatternElement" varName="Elemento" id="Elemento"/>
</inPattern>
</elements>
<elements xsi:type="atl:MatchedRule">
<outPattern>
<elements xsi:type="atl:SimpleOutPatternElement" varName="Componente" id="Componente"/>
</outPattern>
<inPattern>
<elements xsi:type="atl:SimpleInPatternElement" varName="Atributo" id="Atributo"/>
</inPattern>
</elements>
</atl:Module>
<ocl:OclModel model="/0/@inModels.0"/>
<ocl:OclModel model="/0/@outModels.0"/>
<atl:MatchedRule/>
</xmi:XMI>
|