Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Getting the current rule's name
Getting the current rule's name [message #897263] Mon, 23 July 2012 12:52 Go to next message
Juan Pedro Silva is currently offline Juan Pedro SilvaFriend
Messages: 258
Registered: July 2009
Senior Member
Good afternoon.
I have a question regarding the access to metadata from a
transformation. I want to base the generation of some names on the
current rule's name, but I want to specify this in a super rule, and use
inheritance.

So, the question would be, is there a reflective instruction (or some
other means) to access the current rule's metadata?
I'm sorry if this is stated somewhere in the documentation, but I was
not able to find it.

Thanks in advance for your answers.
Regards,
JP
Re: Getting the current rule's name [message #898444 is a reply to message #897263] Thu, 26 July 2012 11:51 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
I know you can get the Module name using thisModule.toString() but getting the rule name isn't possible I think. Instead you can use a work around. Assuming the usual naming convention for rules of SourceElementName+'To'+TargetElementName you can use the following generic ATL to get the rule name Smile
(s.oclType().name+'To'+t.oclType().name)

Regards,
Ronan
Re: Getting the current rule's name [message #899314 is a reply to message #898444] Tue, 31 July 2012 13:01 Go to previous message
Juan Pedro Silva is currently offline Juan Pedro SilvaFriend
Messages: 258
Registered: July 2009
Senior Member
Hi Ronan.
Great tip, I'll may just do that.
Thanks for your answer.
Regards,
JP

El 26/07/2012 13:51, Ronan B escribió:
> Hi,
> I know you can get the Module name using thisModule.toString() but
> getting the rule name isn't possible I think. Instead you can use a work
> around. Assuming the usual naming convention for rules of
> SourceElementName+'To'+TargetElementName you can use the following
> generic ATL to get the rule name :)
> (s.oclType().name+'To'+t.oclType().name)
>
> Regards,
> Ronan
Previous Topic:Error loading File
Next Topic:problem adding an association property to ownedAttribute
Goto Forum:
  


Current Time: Sat Apr 27 00:30:00 GMT 2024

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

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

Back to the top