|
|
|
|
|
|
|
|
Re: Getting ID and Name from Requirements::Requirement [message #1830554 is a reply to message #1830548] |
Wed, 29 July 2020 05:40 |
Tristan Faure Messages: 460 Registered: July 2009 |
Senior Member |
|
|
Hello
about your PS, Anne will answer but no she's not from Obeo company, you can ask for more details at : anne.haugommard@atos.net and stephane.duprat@atos.net
To answer your question I will describe the command (sorry for my wrong advice I made it using memory I should have checked) :
c.getStereotypeApplications().oclAsType(Requirements::Requirement
c => a UML element
c.getStereotypeApplications() => a set of "EObjects"
c.getStereotypeApplications().oclAsType(Requirements::Requirement) => a set of EObjects casted to Requirements
that's why you can't set it to a let
The first recommendation I made did not work because a set has no first method so
c.getStereotypeApplications().oclAsType(Requirements::Requirement)->asSequence() => a sequence of Requirements
c.getStereotypeApplications().oclAsType(Requirements::Requirement)->asSequence()->first() => the first Requirement of the Sequence and there you can save it to a let
the code you mentioned :
[for (s:String | c.getStereotypeApplications().oclAsType(Requirements::Requirement).text)]<drop/>
worked because
c.getStereotypeApplications() => set of EObjects
c.getStereotypeApplications().oclAsType(Requirements::Requirement). => set of requirements
c.getStereotypeApplications().oclAsType(Requirements::Requirement).text => set of texts
[Updated on: Thu, 30 July 2020 06:22] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03876 seconds