Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » Requiremt export(Export a Requirement to Word)
Requiremt export [message #1705962] Thu, 20 August 2015 13:04 Go to next message
David Niehaus is currently offline David NiehausFriend
Messages: 7
Registered: July 2015
Junior Member
Hi all,

I'd like to export a SysML Requirement drawn from a Papyrusmodel xm file into a
Word document by Gendoc. I'm a bit confused because they are represented diffrently from a block. Is there an example to follow?

thx David
Re: Requiremt export [message #1706137 is a reply to message #1705962] Mon, 24 August 2015 07:04 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
To export your requirements from Papyrus models you just have to create a template as defined in the tutorial.

for the Context tag :
select your uml file containing the requirements, if you don't generate diagrams you don't need to import Papyrus bundles

for the Gendoc tag :
Requirements are classes with the Requirement Stereotype so if you want to extract them :

// from a package :
[for (r : uml::Class | self.packagedElement->select(not getAppliedStereotype('SysML::Requirements::Requirement').oclIsUndefined()))]
...
[/for]

// using all Instances :
[for (r : uml::Class | uml::Class.allInstances()->select(not getAppliedStereotype('SysML::Requirements::Requirement').oclIsUndefined()))]
...
[/for]

To get name, ID or text attribute of your Requirement r
name: [r.name.clean()/]
id : [r.getValue(getAppliedStereotype('SysML::Requirements::Requirement'),'id')/]
text : [r.getValue(getAppliedStereotype('SysML::Requirements::Requirement'),'text')/]




Re: Requiremt export [message #1706504 is a reply to message #1706137] Thu, 27 August 2015 12:26 Go to previous messageGo to next message
David Niehaus is currently offline David NiehausFriend
Messages: 7
Registered: July 2015
Junior Member
Hi all,

it worked fine with the provided statements thx a lot.
But I didn't get why this statement

->select(not getAppliedStereotype('SysML::Requirements::Requirement').oclIsUndefined()

provides the
Req-id and Req-text , which are stored in parallel to the model tag within the model.uml file? There is no reference to follow in the uml:Class tag representing the Requirement within the intended package.
I'd like to understand it

thx David
Re: Requiremt export [message #1706506 is a reply to message #1706504] Thu, 27 August 2015 12:32 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
I'm not sure to understand your issue

this line :
->select(not getAppliedStereotype('SysML::Requirements::Requirement').oclIsUndefined()

select the element that have requirement stereotype applied

The instances of stereotypes references the uml element but the invert is not the case that's why you have to use API :
getAppliedStereotype or getValue




Re: Requiremt export [message #1706517 is a reply to message #1706506] Thu, 27 August 2015 13:20 Go to previous messageGo to next message
David Niehaus is currently offline David NiehausFriend
Messages: 7
Registered: July 2015
Junior Member
but you launch the select function on the package and the package looks like this (see below)
There is no element holding the stereo type 'SysML::Requirements::Requirement' within the package?
That's why I'm confused. Sorry

Bye David

<packagedElement xmi:type="uml:Package" xmi:id="_mWtMcEcGEeWrNbF9oWBi-A" name="p_Standorfaktoren_Turmfuß">
...
<packagedElement xmi:type="uml:Class" xmi:id="_jaKJgEcLEeWrNbF9oWBi-A" name="r_Netzspannung 230VAC"/>
<packagedElement xmi:type="uml:Class" xmi:id="_OcYLMEcPEeWrNbF9oWBi-A" name="r_Netzspannung 110VAC"/>
<packagedElement xmi:type="uml:Class" xmi:id="_F8vlEEcSEeWrNbF9oWBi-A" name="r_Netzspannung Frequenztoleranzen"/>
<packagedElement xmi:type="uml:Class" xmi:id="_vUdz0EcVEeWrNbF9oWBi-A" name="r_Netzspannung Spannungstoleranzen 1"/>
<packagedElement xmi:type="uml:Class" xmi:id="_Ufit4EcXEeWrNbF9oWBi-A" name="r_Netzspannung Spannungstoleranzen 2"/>
<packagedElement xmi:type="uml:Class" xmi:id="_sXPi0EcXEeWrNbF9oWBi-A" name="r_Netzspannung Spannungstoleranzen 3"/>
<packagedElement xmi:type="uml:Abstraction" xmi:id="_5L9WAEcYEeWrNbF9oWBi-A" name="DeriveReqt1" client="_vUdz0EcVEeWrNbF9oWBi-A" supplier="_-73SYEcIEeWrNbF9oWBi-A"/>
<packagedElement xmi:type="uml:Abstraction" xmi:id="_7MBJQEcYEeWrNbF9oWBi-A" name="DeriveReqt2" client="_Ufit4EcXEeWrNbF9oWBi-A" supplier="_-73SYEcIEeWrNbF9oWBi-A"/>
...
</packagedElement>
Re: Requiremt export [message #1706803 is a reply to message #1706517] Mon, 31 August 2015 09:35 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
OK i understand your concern
instances of stereotypes (like SysML::Requirements) are located at the end of the file and references (through base_...) the element with the stereotype applied.

As there is no reference between the class and the requirement you have to use getApplyStereotype functions




Previous Topic:Changing global variable value
Next Topic:String
Goto Forum:
  


Current Time: Wed Dec 04 10:37:00 GMT 2024

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

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

Back to the top