Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » error in ATL transformation
error in ATL transformation [message #1753169] Thu, 02 February 2017 11:48 Go to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
I have an error in this line of code (source is 1..1 reference). I have no idea about why model can not generate. How can I solve it?

class <- s.source -> collect (si|thisModule.CreateClass(si))


Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: error in ATL transformation [message #1753179 is a reply to message #1753169] Thu, 02 February 2017 13:31 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
class <- thisModule.CreateClass(s.source)
?
Re: error in ATL transformation [message #1753181 is a reply to message #1753179] Thu, 02 February 2017 13:47 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Yes, it works. Thank you

Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Thu, 02 February 2017 14:13]

Report message to a moderator

Re: error in ATL transformation [message #1753881 is a reply to message #1753181] Sat, 11 February 2017 14:18 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
I have another error in the line below of my transformation. Can anyone tell me what is wrong in this line of code?
association <- s.targets -> collect(sope|sope.eContainer().oclAsType(MM_ETL!TransformationRule).body.statements.oclAsType(MM_ETL!AssignmentStatement))


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Mon, 13 February 2017 08:03]

Report message to a moderator

Re: error in ATL transformation [message #1754128 is a reply to message #1753881] Tue, 14 February 2017 16:07 Go to previous messageGo to next message
louis andia. is currently offline louis andia.Friend
Messages: 47
Registered: November 2016
Member
Unfortunately, oclAsType is not available in ATL, just remove them or replace them by 'select'.
eContainer is refImmediateComposite in ATL.

"refImmediateComposite()

This is a reflective operation that returns the immediate
composite (e.g. the immediate container) of self"

Re: error in ATL transformation [message #1754166 is a reply to message #1754128] Tue, 14 February 2017 21:51 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Thanks,
How can I replace it with select?
When I change it to below code, it has error.
association <- s.targets -> collect(sope|sope.refImmediateComposite().body.statements->select (e|e.oclIsKindOf(MM_ETL!AssignmentStatement)))


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Tue, 14 February 2017 21:55]

Report message to a moderator

Re: error in ATL transformation [message #1754268 is a reply to message #1754166] Wed, 15 February 2017 22:36 Go to previous message
louis andia. is currently offline louis andia.Friend
Messages: 47
Registered: November 2016
Member
It's more something like that:
association <- s.targets -> collect(sope|sope.refImmediateComposite())
                         ->select(tfRule| tfRule.oclIsKindOf(MM_ETL!TransformationRule))
                         ->collect(tfRule | tfRule.body.statements)->flatten()
                         ->select(stat | stat.oclIsKindOf(MM_ETL!AssignmentStatement))

[Updated on: Wed, 15 February 2017 22:38]

Report message to a moderator

Previous Topic:Problem with navigating in ATL
Next Topic:Access the metamodel name and address through code
Goto Forum:
  


Current Time: Thu Apr 25 04:48:22 GMT 2024

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

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

Back to the top