Re: ETL, ::= and equivalent() [message #584961] |
Sun, 24 January 2010 11:07  |
Eclipse User |
|
|
|
Re,
I'm trying to add inheritance management to the transformation :
rule ePackage2Package
transform i : ecore!EPackage
to o : doctrine!doctrine::Record::Package{
o.name = i.name;
if( i.eSuperPackage.isDefined())
{
o.superPackage ::= i.eSuperPackage;
}
if( i.eSubpackages.isDefined() )
{
for( package in i.eSubpackages )
{
o.subPackages.add( package.equivalent() );
}
}
if( i.eClassifiers.isDefined() )
{
for( class in i.eClassifiers )
{
o.records.add( class.equivalent() );
}
}
}
rule eClass2Record
transform i : ecore!EClass
to o : doctrine!doctrine::Record::Record{
if( i.ePackage.isDefined() )
{
o.package ::= i.ePackage;
}
o.name = i.name;
if( i.eSuperTypes.select(c|not c.interface).size()>0)
{
o.inheritance = doctrine!doctrine::Record::Inheritance::Inheritance.createIn stance();
o.inheritance.extending ::= i.eSuperTypes.select(c|not c.interface).first(); //line 40
}
}
But I get this error : Property 'extending' not found in object Record [name=Party, ] (/home/serard/Documents/workspaces/modeling_one/se.ecore2doc trine/src/mailto:ecore2doctrine.etl@40:26)
(from model, I deleted the doctrine!Model element to use Package instead and renamed the Record.extends to extending to avoid some more problems, but looks like it is not solving the problem -_-)
Thanks :)
|
|
|
|
|
Re: ETL, ::= and equivalent() [message #585003 is a reply to message #584997] |
Sun, 24 January 2010 13:10  |
Eclipse User |
|
|
|
Hi Stephane,
The problem was that you configured your models as "EMF Decorator
Model"s instead of plain "EMF Model"s. Not quite sure what might be
going wrong with this (another bugzilla is probably due) but
reconfiguring your models as plain EMF models solves this problem.
Below is the modified ecore2doctrine.launch
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration
type=" org.epsilon.etl.eclipse.dt.launching.EtlLaunchConfigurationD elegate ">
<listAttribute key="models">
<listEntry value="# #Sun Jan 24 18:03:38 GMT
2010 isMetamodelFileBased=false &am p;#10;name=ecore readOnLoad=true &a mp;#10;storeOnDisposal=false aliases=ecore& amp;#13; metamodelUri=http\://www.eclipse.org/emf/2002/Ecore
 ; type=EMF modelFile=/se.eds.mm/mod el/eds.ecore expand=true m etamodelFile= "/>
<listEntry value="# #Sun Jan 24 18:03:41 GMT
2010 isMetamodelFileBased=true & ;#10;name=doctrine readOnLoad=false
 ; storeOnDisposal=true aliases=& ;#13; metamodelUri= type=EMF 3; modelFile=/se.ecore2doctrine/src/gen.xmi expand=true metamodelFile=/se.doct rine.mm/model/doctrine.ecore "/>
</listAttribute>
<stringAttribute key="source"
value="/se.ecore2doctrine/src/ecore2doctrine.etl"/>
</launchConfiguration>
Cheers,
Dimitris
Stéphane wrote:
> Latest here (I'll have a svn soon ^^):
> http://stephaneerard.fr/modeling_one.zip
>
> I have problems in ecore2doctrine.etl at lines
> 41,
> 68
>
> If you have any suggestion for other things (way I code, etc), don't
> hesitate ;)
>
> Thaaaanks :o)
|
|
|
Powered by
FUDForum. Page generated in 0.03571 seconds