Requirement.derived generation into document [message #1775026] |
Mon, 23 October 2017 12:57  |
Eclipse User |
|
|
|
Hello,
I would like to ask, how can I list into a document the derived requirements of a requirement?
I try this, but it doesn't work. :-(
[for (
d : Class |
r.ownedElement
->filter(Class)
->select(not getAppliedStereotype('SysML::Requirements::Requirement').oclIsUndefined())
->sortedBy(
c1 : Class |
c1.getValue(
getAppliedStereotype('SysML::Requirements::Requirement'),
'id'
).toString()
)
)]
Derived:
[if (d.getValue(getAppliedStereotype('SysML::Requirements::Requirement'),'derived')->flatten()->notEmpty())]<drop/>
[for (
derived : Class |
d.getValue(
getAppliedStereotype('SysML::Requirements::Requirement'),
'derived'
)->flatten()
)]<drop/>
[derived.getValue(getAppliedStereotype('SysML::Requirements::Requirement'),'id')/]
[/for]<drop/>
[else]<drop/>
There isn't derived requirements.
[/if]<drop/>
[/for]
The question is same the similar attributes (derivedFrom, refinedBy, etc.) of Requirement.
And somebody explain to me why I have to use 'flatten()' function?
Thank You in advance for your help.
Regards,
Feri
|
|
|
|
Re: Requirement.derived generation into document [message #1775466 is a reply to message #1775461] |
Mon, 30 October 2017 10:26  |
Eclipse User |
|
|
|
Hi
You might get more response if you put OCL/Acceleo/AQL in the title line, and probably if you asked on the relevant newsgroup.
Your example appears to be Acceleo/AQL using the type-unsafe UML Java API.
But Papyrus supports the new Pivot OCL which has a typesafe stereotype API. Hovertext to help understand the type system, and a debugger when life gets hard.
I am therefore unclear what you are trying to do.
You no doubt need to flatten for the usual reason, You have a multi-depth collection.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.06057 seconds