Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Model-to-Model Transformation » "oclAsType" in ATL
"oclAsType" in ATL [message #1754190] Wed, 15 February 2017 07:37 Go to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 264
Registered: July 2016
Senior Member
Hi,

I want to know what is the equivalent of "OclAsType" in ATL?
I see in some transformation, select and oclIsKindOf are used.
In the figure below, I wanna to access "name" attribute of "SubSubElement" class.

index.php/fa/28471/0/

when I write the below code I have an error. What can I do?

s : MM!Exp
.
.
.
class <- s.ref.oclIsKindOf(MM!SubElement).oclIsKindOf(MM!SubSubElement).name
  • Attachment: sub.JPG
    (Size: 17.20KB, Downloaded 154 times)

[Updated on: Wed, 15 February 2017 07:42]

Report message to a moderator

Re: "oclAsType" in ATL [message #1754236 is a reply to message #1754190] Wed, 15 February 2017 15:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6066
Registered: July 2009
Senior Member
Hi

Try using oclAsType rather than oclIsKIndOf twice.

Regards

Ed Willink
Re: "oclAsType" in ATL [message #1754237 is a reply to message #1754236] Wed, 15 February 2017 16:02 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 264
Registered: July 2016
Senior Member
Thanks for your response,
The operation oclAsType() defined by OCL are currently not supported by the ATL engine [1].

[1] https://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language
Re: "oclAsType" in ATL [message #1754253 is a reply to message #1754237] Wed, 15 February 2017 17:44 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6066
Registered: July 2009
Senior Member
Hi

Ow! The operations oclIsNew() and oclAsType() defined by OCL are currently not supported by the ATL engine.

Omitting oclIsNew() is very understandable, it is very hard and very costly to support and I've yet to want to use it. Omitting oclAsType() is very unfortunate. It is very useful and very easy to implement. I see no Bugzilla requesting it.

I guess that the justification is that a declaration transformation language does pattern matching and so assignments do oclAsType automatically or fail.

Regards

Ed Willink
Previous Topic:Assignment statement in ATL helpers
Next Topic:"Binding" and "BindingStat" in ATL
Goto Forum:
  


Current Time: Wed Oct 17 16:02:16 GMT 2018

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

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

Back to the top