Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » java.ecore Metamodel Type/TypeAccess(on FieldDeclarations, SingleVariableDeclarations, MethodDeclarations)
java.ecore Metamodel Type/TypeAccess [message #662590] Thu, 31 March 2011 09:01 Go to next message
Rob is currently offline RobFriend
Messages: 17
Registered: February 2011
Junior Member
Hello again! Smile

I am not quite sure if I should ask the following here or in the M2M ATL Forum, but as I have a problem with ATL Rules on the java.ecore Metamodel which comes with MoDisco I think it should be ok here.

I created a java.ecore based app model with Modisco Reverse Engineering and used ATL to extract some information from this model.
I am running into a problem which maybe one of you guys can clearify.

Let's have some lazy rules say:

lazy rule F2F {
	from
		s: Java!FieldDeclaration
	to
		t : Java!FieldDeclaration (
			type <- thisModule.TA2TA(f),
		)
}

lazy rule TA2TA {
	from
		f: Java!TypeAccess
	to
		t : Java!TypeAccess (
			type <- if (f.type.type.oclIsKindOf(Java!PrimitiveTypeVoid))
.....
					


The rules work so far for Parameters (SingleVariableDeclaration) and FieldDeclarations.

But am not quite sure, why I have to access type twice here - but this way the checks work - although I can not figure it out from the metamodel. From my understanding it should work with f.type.olcIsKindOf ...

the same code works for Parameters (i.e. SingleVariableDeclarations)

but when I try to transfer returnType in MethodDeclaration I get an error, that type is not valid for MethodDeclaration.

Maybe I am missunderstanding some concepts of ATL or something in the java.ecore Metamodel. But I dig through the Metamodel and from my point of view it should not matter whether it is type in SingleVariableDeclaration/AbstractVariablesContainer or returnType in MethodDeclaration.

Any hints would be appreciated.

many thx in advance,
Rob

[Updated on: Thu, 31 March 2011 09:13]

Report message to a moderator

Re: java.ecore Metamodel Type/TypeAccess [message #662650 is a reply to message #662590] Thu, 31 March 2011 12:43 Go to previous message
Rob is currently offline RobFriend
Messages: 17
Registered: February 2011
Junior Member
Solving my own problem

bad mistake.

Had to pass f.type/f.returnType when calling the TA2TA rule - for sure
Embarrassed

Thanks anyway
Rob Rolling Eyes
Previous Topic:MoDisco talk yesterday at EclipseCon 2011...
Next Topic:[ATL] Run Modisco .javaxmi transformation programmatically
Goto Forum:
  


Current Time: Sat Dec 20 04:30:00 GMT 2014

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

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