Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » Provide Comments behind a Requirement
Provide Comments behind a Requirement [message #1764129] Thu, 25 May 2017 14:42 Go to next message
Marcel d'Heureuse is currently offline Marcel d'HeureuseFriend
Messages: 3
Registered: May 2017
Junior Member
Hi,
I have tried to seach at the internet but i didn't find how to export a comment behind a Eclipse Papyrus requirements:

For exporting of a full list of the requirements in my Model i use this script:

<context model='${model}' importedBundles='commons;gmf;papyrus' searchMetamodels='true'/>
<gendoc>
[for (re:Requirement | Requirement.allInstances())]<drop/>
1. [re. base_Class.name/]
• Modellpfad : [re.base_Class.qualifiedName/]
• Id : [re.id/]
• Text :
[re.text /]

[/for]<drop/>
</gendoc>

I tried to use the self.displaycomments with the Fragment:

<fragment name='displayComment'> <drop/>
<arg name='e' type='uml::Element'/> <drop/>
[for (description : String | e.eContents()->filter(uml::Comment)->select(c |c.annotatedElement->includes(e))._body.splitNewLine())][description.clean()/]
[/for] <drop/>
</fragment> <drop/>

But uml::Element or uml::Requirement is not working.

Did you have a solution here?

Thanks
Marcek
Re: Provide Comments behind a Requirement [message #1764395 is a reply to message #1764129] Mon, 29 May 2017 11:31 Go to previous messageGo to next message
Antonio Campesino is currently offline Antonio CampesinoFriend
Messages: 43
Registered: August 2016
Member
Hi Marcel,

I guess you are using a SysML model, in that case the SysML is a profile applied to a UML model. So all the entities are uml elements. This means if you want to query the SysML constructions, you need to query the UML elements that has the SysML stereotypes applied and query the stereotype properties.

In your case, to query all the Requirements in the model, you need to do:

<config><output path='${output}'/></config><drop/>
<context model='${model}' importedBundles='gmf;papyrus;commons' searchMetamodels='true'/><drop/>
<gendoc><drop/>
[for (re : uml::Class | uml::Class.allInstances()->select(c : uml::Class | c.getAppliedStereotype('SysML::Requirements::Requirement') <> null))] <drop/>
1. [re.name/]
• Modellpfad : [re.qualifiedName/]
• Id : [re.getValue(re.getAppliedStereotype('SysML::Requirements::Requirement'), 'id')/]
• Text : [re.getValue(re.getAppliedStereotype('SysML::Requirements::Requirement'), 'text')/]
[/for]<drop/>
</gendoc>

Regards,
Antonio
Re: Provide Comments behind a Requirement [message #1764404 is a reply to message #1764395] Mon, 29 May 2017 12:37 Go to previous messageGo to next message
Anne Haugommard is currently offline Anne HaugommardFriend
Messages: 11
Registered: October 2013
Junior Member
Hi Marcel,

You can also keep your loop on Requirement objects and call the fragment 'displayComment' with the UML Class that is associated to the Requirement as input, using the following instruction :
[re.base_Class.displayComment()/]

Regards,
Anne


- Anne
Re: Provide Comments behind a Requirement [message #1773334 is a reply to message #1764404] Tue, 26 September 2017 14:31 Go to previous message
Marcel d'Heureuse is currently offline Marcel d'HeureuseFriend
Messages: 3
Registered: May 2017
Junior Member
Hi Antoni and Anne,

Thanks for your Replay but i can't get my configuration running.

I will start from beginn und hopefully i have only make not big fails.

Br
Marcel
Previous Topic:Lost of Papyrus module
Next Topic:"->" in queries
Goto Forum:
  


Current Time: Sun Nov 18 16:03:19 GMT 2018

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

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

Back to the top