Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » thisModule.resolveTemp() returns OclUndefined
thisModule.resolveTemp() returns OclUndefined [message #1577060] Wed, 21 January 2015 17:43 Go to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hello,

I'm playing around with the ATL-Framework and came across the following strange behavior:

resolveTemp(var, target_pattern_name) should return an targetelement to a corresponding sourceelement, by accessing the current trace.

But it only returns an OclUndefined and I really don't know why.
To demonstrate this, I created an example ATL-project with the following transformation:

-- @path TRIANGLE=/Z_ATL_TEST/mm/Triangle.ecore
-- @path CIRCLE=/Z_ATL_TEST/mm/Circle.ecore


module transfo;
create OUT: TRIANGLE from IN: CIRCLE;

rule mod2mod {
	from
		s: CIRCLE!CircleModel
	to
		t: TRIANGLE!Model (
			name <- s.name,
			triangles <- s.circles
		)
}

rule circ2triang {
	from
		s: CIRCLE!Cirlce
	to
		t: TRIANGLE!Triangle (
			color <- s.color
		)
	do {
		thisModule.println(thisModule.resolveTemp(s.refImmediateComposite(), 'model')); 
	}
}

helper def: println(enu: OclAny): OclAny =
	enu.debug();



But the enu.debug() prints only OclUndefined, why is this so? What am I doing wrong?

Any suggestions welcome!

~Alex

[Updated on: Wed, 21 January 2015 17:44]

Report message to a moderator

Re: thisModule.resolveTemp() returns OclUndefined [SOLVED] [message #1578237 is a reply to message #1577060] Thu, 22 January 2015 09:17 Go to previous message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
The call:
 thisModule.resolveTemp(sa.refImmediateComposite(),'t')
need as a second parameter the name of the local variable in the output-pattern!

~Alex
Previous Topic:Building a Map Dynamically
Next Topic:Mutliple meta models extending another meta model
Goto Forum:
  


Current Time: Thu Apr 25 00:28:26 GMT 2024

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

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

Back to the top