Skip to main content



      Home
Home » Modeling » Model-to-Model Transformation » "oclAsType" in ATL
"oclAsType" in ATL [message #1754190] Wed, 15 February 2017 02:37 Go to next message
Eclipse UserFriend
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 500 times)

[Updated on: Wed, 15 February 2017 02:42] by Moderator

Re: "oclAsType" in ATL [message #1754236 is a reply to message #1754190] Wed, 15 February 2017 10:52 Go to previous messageGo to next message
Eclipse UserFriend
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 11:02 Go to previous messageGo to next message
Eclipse UserFriend
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 12:44 Go to previous message
Eclipse UserFriend
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: Sat Aug 30 19:06:26 EDT 2025

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

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

Back to the top