Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » resolveTemp crashes the ATL module
resolveTemp crashes the ATL module [message #1120568] Sun, 29 September 2013 19:22 Go to next message
Leonardo Montecchi is currently offline Leonardo MontecchiFriend
Messages: 3
Registered: September 2013
Junior Member
Hello,

I'm trying to use the resolveTemp function within an ATL module. However, I'm experiencing a very strange behavior:

When calling
thisModule.resolveTemp(v, 'name');

...
If NO rule exists for 'v' creating an object named 'name', then the function is executed and returns OclUndefined, as it should

If such rule exists, then the ATL module creashes: the execution is interrupted (with not exceptions on the console) and the output file is not generated at all.

Coult you please help me, or point to some direction? I'm calling

thisModule.resolveTemp(e, 'detected').debug();

from the "do" part of a MatchedRule, and the resolveTemp is supposed to reference another MatchedRule... so it should be the right place within the module.

Thanks.


Leonardo Montecchi, PhD Student
Università degli Studi di Firenze
Re: resolveTemp crashes the ATL module [message #1122366 is a reply to message #1120568] Tue, 01 October 2013 13:45 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 612
Registered: July 2009
Senior Member
Hello,

Have you tried to call to the resolveTemp method from outside of the "do" section (i.e., in the regular matched rule assignments)?
Such "do" sections are dedicated to imperative constructs that should be use only when strictly needed.
In a great majority of cases, ATL declarative constructs (i.e., matched rules) are sufficient.

Best regards,


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: resolveTemp crashes the ATL module [message #1123457 is a reply to message #1122366] Wed, 02 October 2013 15:31 Go to previous messageGo to next message
Leonardo Montecchi is currently offline Leonardo MontecchiFriend
Messages: 3
Registered: September 2013
Junior Member
Hello,

thanks for your answer.
It took me a while to figure out how to do the same thing within regular matched rules, but it is possible, thanks for your suggestion.

It actually works if called from another rule, in the declarative section.
That is, instead of calling resolveTemp in rule A for finding element X of rule B, I call it in rule B for finding element Y of rule A.

However the module still crashes if I add the .debug() operation:

target <- thisModule.resolveTemp(e.refImmediateComposite(),'reset'),
--OK

target <- thisModule.resolveTemp(e.refImmediateComposite(),'reset').debug(),
--Crashes (with no visible hints)

Best regards,


Leonardo Montecchi, PhD Student
Università degli Studi di Firenze
Re: resolveTemp crashes the ATL module [message #1127972 is a reply to message #1123457] Mon, 07 October 2013 07:36 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 248
Registered: July 2009
Senior Member
Hi,
In my experience using debug statements with resolveTemp can result in different behaviour compared with just calling resolveTemp. This may be related to the semantics of resolveTemp which is using the generated target model.
Regrads,
Ronan
Previous Topic:Inject operation in ATL 3.0
Next Topic:[ATL /AM3 XML Extractor ]
Goto Forum:
  


Current Time: Mon Nov 24 02:43:48 GMT 2014

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

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