Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » Getting only applied comments
Getting only applied comments [message #1746264] Wed, 26 October 2016 09:19 Go to next message
Marc FLAUW is currently offline Marc FLAUWFriend
Messages: 151
Registered: July 2009
Senior Member
Hi,

I would like to get only the Applied Comments of an element.
Today, I am able to get all the owned comments using the following fragment:
<fragment name='displayComments' importedBundles='commons;gmf;papyrus'><drop/>
<arg name='element' type='uml::Element'/><drop/>
[for (co:uml::Comment | element. ownedComment)]<drop/>
Description: <dropEmpty>[co._body.clean()/]</dropEmpty>
[/for]<drop/>
</fragment><drop/>


I tried to replace "ownedComment" by "appliedComment, but this does not work, the variable is unrecognized.

Any way to do this?

Thanks,

Marc
Re: Getting only applied comments [message #1746874 is a reply to message #1746264] Mon, 07 November 2016 07:40 Go to previous messageGo to next message
Anne HAUGOMMARD is currently offline Anne HAUGOMMARDFriend
Messages: 13
Registered: October 2013
Junior Member
Hi Marc,


The difference between an appliedComment and a ownedComment is the attribute "annotatedElement" that is set with the object the comment is applied to.

So the following should give you only the applied comments

<fragment name='displayAppliedComments' importedBundles='commons;gmf;papyrus'><drop/>
<arg name='element' type='uml::Element'/><drop/>
[for (co:uml::Comment | element. ownedComment->select(annotatedElement=self))]<drop/>
Description: <dropEmpty>[co._body.clean()/]</dropEmpty>
[/for]<drop/>
</fragment><drop/>

Anne


- Anne
Re: Getting only applied comments [message #1746875 is a reply to message #1746874] Mon, 07 November 2016 07:44 Go to previous message
Marc FLAUW is currently offline Marc FLAUWFriend
Messages: 151
Registered: July 2009
Senior Member
Hi Anne,

Thanks.
in fact this post was done in duplicate due to a browser problem and Tristan already answerd on the other post (https://www.eclipse.org/forums/index.php?t=msg&th=1082102&goto=1746263&#msg_1746263)

It is the same answer and it works fine, thanks.

Best regards,

Marc
Previous Topic:No content in eclipse variables
Next Topic:Getting Default Values
Goto Forum:
  


Current Time: Fri Apr 26 18:56:14 GMT 2024

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

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

Back to the top