|
|
Re: ATL - Using elements of a referenced metamodel [message #503042 is a reply to message #503024] |
Thu, 10 December 2009 16:25 |
Simon Messages: 13 Registered: October 2009 |
Junior Member |
|
|
Hi Alex,
thanks for your answer.
I tried to simplify the metamodels in my first post, but to getter a better idea, I will describe it again more detailed:
I have a metamodel MDBPECompany as seen in the picture
The meta models inherits over a 4 steps way from mwcore.
All the metamodels are generated packages and registered in the emf packageregistry.
When I start my transformation with a model I got the following error message:
Quote: |
Cannot find class WElement in reference model MDBPECompany
|
My complete transformation looks like:
module Company2Department;
create OUT : MDBPEDepartment from IN : MDBPECompany;
--weaving stuff
abstract rule WElem {
from
i : MDBPECompany!WElement
to
o : MDBPEDepartment!WElement(
name <- i.name,
description <- i.description
)
}
--rule for the Annotationmodel
rule Annotationmodel extends WElem {
from
i : MDBPECompany!AnnotationModel
to
o : MDBPEDepartment!AnnotationModel (
contents <- i.contents
)
}
rule Annotation extends WElem {
from
i : MDBPECompany!Annotation
to
o : MDBPEDepartment!Annotation (
properties <- i.properties
)
}
--create from one Company 2 Departments
rule Department {
from
i : MDBPECompany!Company
to
d1 : MDBPEDepartment!Department (
name <- i.name + ' - Specialists',
data <- i.data
),
d2 : MDBPEDepartment!Department (
name <- i.name + ' - Management',
data <- i.data
)
}
When I remove the abstract part and the extends and set in each rule name and description, the transformation works perfect.
Any suggestions appreciated?
Thanks already for your help
Simon
[Updated on: Thu, 10 December 2009 16:30] Report message to a moderator
|
|
|
|
Re: ATL - Using elements of a referenced metamodel [message #529152 is a reply to message #503042] |
Fri, 23 April 2010 08:44 |
William Piers Messages: 301 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------010206020406070101030609
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hi,
It seems to be a bug in inheritance, as it works when you remove it.
Could you report a bug about that ?
( https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2M& component=ATL-Engine)
Best regards,
William
Le 10/12/2009 17:25, Simon a écrit :
> Hi Alex,
>
> thanks for your answer. I tried to simplify the metamodels in my first
> post, but to getter a better idea, I will describe it again more detailed:
>
>
> I have a metamodel MDBPECompany as seen in the picture
>
> The meta models inherits over a 4 steps way from mwcore.
>
> All the metamodels are generated packages and registered in the emf
> packageregistry.
>
> When I start my transformation with a model I got the following error
> message:
> Quote:
>> Cannot find class WElement in reference model MDBPECompany
>
>
> My complete transformation looks like:
>
>
> module Company2Department;
>
> create OUT : MDBPEDepartment from IN : MDBPECompany;
>
> --weaving stuff
> abstract rule WElem {
> from
> i : MDBPECompany!WElement
> to
> o : MDBPEDepartment!WElement(
> name <- i.name,
> description <- i.description
> )
>
> }
>
> --rule for the Annotationmodel
> rule Annotationmodel {
> from
> i : MDBPECompany!AnnotationModel to
> o : MDBPEDepartment!AnnotationModel (
> contents <- i.contents
> )
> }
>
> rule Annotation {
> from
> i : MDBPECompany!Annotation to
> o : MDBPEDepartment!Annotation (
> properties <- i.properties
> )
> }
>
> --create from one Company 2 Departments
> rule Department {
> from
> i : MDBPECompany!Company to
> d1 : MDBPEDepartment!Department (
> name <- i.name + ' - Specialists',
> data <- i.data
> ),
> d2 : MDBPEDepartment!Department (
> name <- i.name + ' - Management',
> data <- i.data
> )
> }
>
>
> When I remove the abstract part and set in each rule name and
> description, the transformation works perfect.
>
>
> Any suggestions appreciated?
>
> Thanks already for your help
> Simon
--------------010206020406070101030609
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
--------------010206020406070101030609--
|
|
|
Re: ATL - Using elements of a referenced metamodel [message #529153 is a reply to message #529012] |
Fri, 23 April 2010 08:45 |
William Piers Messages: 301 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070005000401050108030503
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hello,
Here are some details about metamodel registration. ATL registers
metamodels as follow:
- register all the types of the given resource (the metamodel specified
in the launch configuration)
- for all types, registers all types referenced by the first types list
* references targets
* attribute types
* supertypes
In some cases, this system is too "light", e.g.:
MM1 A
MM2 B extends A
MM3 C extends A
With this structure, as ATL require ONE base metamodel, it is not
possible to access both A,B,C
A as root -> only A is available
B as root -> only A, B are available
C as root -> only A, C are available
This is a bug you can report here:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2M& component=ATL-Engine
A workaround consists on defining another metamodel which refers to B
and C, and finally to use it in the ATL launch configuration.
MM4 D extends B,C
If this workaround doesn't work for you, maybe there is another cause.
If you want to debug here are the places where registration is achieved:
Regular-VM :
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.m2m.atl/plugins/org.eclipse.m2m.atl.drivers.emf4atl /src/org/eclipse/m2m/atl/drivers/emf4atl/ASMEMFModel.java?ro ot=Modeling_Project&view=markup
see
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.addReference dExtentsFor(EClass,
Set)
EMFVM :
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.m2m.atl/plugins/org.eclipse.m2m.atl.core.emf/src/or g/eclipse/m2m/atl/core/emf/EMFReferenceModel.java?root=Model ing_Project&view=markup
see
org.eclipse.m2m.atl.core.emf.EMFReferenceModel.addReferenced ResourcesFor(EClass,
Set<EClass>)
Best regards,
William
Le 22/04/2010 17:56, S a écrit :
> I do have the same problem.
>
> I cannot find a way to apply an ATL transformation on a single
> resrouce-model that uses a multiple-resources metamodel.
>
> It crashes at loading the model when parsing a property inherited from
> another resource than the current metaclass.
>
> Is there a ROTFM section I did not read or something equivelent?
> Thank you.
--------------070005000401050108030503
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
--------------070005000401050108030503--
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02541 seconds