Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Identify leaf classes
Identify leaf classes [message #1062827] Tue, 11 June 2013 00:13 Go to next message
Mahin Abbasipour is currently offline Mahin AbbasipourFriend
Messages: 24
Registered: June 2013
Junior Member
Hi,

I have a UML model, a hierarchy of UML classes which are connected by dependency to each other. A defined UML profile is applied on this model. In the transformation, I want to distinguish if a specific class is leaf or not. The only property that I know about each class is "clientDependency". When this property is not set, it means that the class is the root class. But I don't know how I can write the rules to specify the leaf classes. It would be great if anyone can give a clue.

Thanks,
Mahin
Re: Identify leaf classes [message #1062892 is a reply to message #1062827] Tue, 11 June 2013 09:25 Go to previous messageGo to next message
Javier García is currently offline Javier GarcíaFriend
Messages: 129
Registered: April 2013
Senior Member
If I understand correctly the leaf class will be the one that has no dependencies pointing to it right?
So then you can do a helper like this:

helper context UML!Class def:isLeaf(): Boolean =
UML!Dependency.allInstances()->select (e|e.supplier.name = self.name).isEmpty()
;


I'd recommend using the allInstances() on an attribute so you call it only once.

[Updated on: Tue, 11 June 2013 09:25]

Report message to a moderator

Re: Identify leaf classes [message #1063741 is a reply to message #1062892] Fri, 14 June 2013 02:51 Go to previous message
Mahin Abbasipour is currently offline Mahin AbbasipourFriend
Messages: 24
Registered: June 2013
Junior Member
Dear Javier,
Thank you very much for the hint as well.
Previous Topic:EMFTVM Refining Mode
Next Topic:TCS plugin
Goto Forum:
  


Current Time: Tue Apr 23 13:26:38 GMT 2024

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

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

Back to the top