Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATL - Using elements of a referenced metamodel(using of metamodel elements of referenced metamodel does not work)
ATL - Using elements of a referenced metamodel [message #502998] Thu, 10 December 2009 14:43 Go to next message
Simon is currently offline SimonFriend
Messages: 13
Registered: October 2009
Junior Member
Hello Community,

I have a problem with the following transformation

I have a metamodel specialbusinesscore as seen in the picture
http://www.firehawkentertainment.de/images/metamodels.png
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 specialbusinesscore



My transformation looks like:

module Company2Department;

create OUT : MDBPEDepartment from IN : specialbusinesscore;

--weaving stuff
abstract rule WElem {
	from
	    i : specialbusinesscore!WElement 
	to		
		o : MDBPEDepartment!WElement (
			name <- i.name,
			description <- i.description			
			)
	
}

rule Annotation extends WElem {
	from
	    i : specialbusinesscore !Annotation 
	to		
		o : MDBPEDepartment!Annotation (			
			name <- i.name,
			description <- i.description
			)
}


Any suggestion for the solving the error?

Thanks already for your help
Simon
Re: ATL - Using elements of a referenced metamodel [message #503024 is a reply to message #502998] Thu, 10 December 2009 15:46 Go to previous messageGo to next message
Alex Schenkman is currently offline Alex SchenkmanFriend
Messages: 21
Registered: October 2009
Location: Sweden
Junior Member
Simon:

Test one thing at the time. Leave inheritance out for now until you get the metamodels working. The "to" part of the Annotation rule is the same than the first rule.

About inheritance, I think classes inherit from each other but modules do not. This means that there is no Annotation class in special metamodel bussinesscore, but an AnnotationProperty.

Godd luck!






Re: ATL - Using elements of a referenced metamodel [message #503042 is a reply to message #503024] Thu, 10 December 2009 16:25 Go to previous messageGo to next message
Simon is currently offline SimonFriend
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
http://www.firehawkentertainment.de/images/metamodels.jpg
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 #529012 is a reply to message #503042] Thu, 22 April 2010 15:56 Go to previous messageGo to next message
S is currently offline SFriend
Messages: 2
Registered: April 2010
Junior Member
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.
Re: ATL - Using elements of a referenced metamodel [message #529152 is a reply to message #503042] Fri, 23 April 2010 08:44 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
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 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
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--
Re: ATL - Using elements of a referenced metamodel [message #529173 is a reply to message #529153] Fri, 23 April 2010 09:34 Go to previous messageGo to next message
S is currently offline SFriend
Messages: 2
Registered: April 2010
Junior Member
Ok, thank you for your answer.

My problem is a bit more tricky than the one described by Simon and your "assembly" M2 workaround does not work.

I'll check the model loader debug/patch solution.

I'll keep you in touch.
Re: ATL - Using elements of a referenced metamodel [message #529885 is a reply to message #502998] Tue, 27 April 2010 14:53 Go to previous message
graa is currently offline graaFriend
Messages: 42
Registered: April 2010
Member
hi,

is it possible to copy the header of fichier.atl because like you I use many metamodel and I do not understand how I can integrate them.

thanks
Previous Topic:[QVTo] How to create a model (extent) from an element.
Next Topic:[ATL] Atl doesn't preserve order of a metamodel ordered attribute
Goto Forum:
  


Current Time: Thu Mar 28 16:01:43 GMT 2024

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

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

Back to the top