Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Requirement.derived generation into document(How can I generate derived, derivedFrom, or other list typed attributes of SysML::Requirementsr::Requirement?)
Requirement.derived generation into document [message #1775026] Mon, 23 October 2017 16:57 Go to next message
Ferenc Magnucz is currently offline Ferenc MagnuczFriend
Messages: 6
Registered: October 2017
Junior Member
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 #1775461 is a reply to message #1775026] Mon, 30 October 2017 13:14 Go to previous messageGo to next message
Ferenc Magnucz is currently offline Ferenc MagnuczFriend
Messages: 6
Registered: October 2017
Junior Member
Nobody can help me? :-(
I have searched by Google, but I haven't found the answer. :-(

[Updated on: Mon, 30 October 2017 13:16]

Report message to a moderator

Re: Requirement.derived generation into document [message #1775466 is a reply to message #1775461] Mon, 30 October 2017 14:26 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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
Previous Topic:Multiplicity and Navegability of an association (class)
Next Topic:Profile conversion to SysML 1.4
Goto Forum:
  


Current Time: Thu Apr 25 09:09:06 GMT 2024

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

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

Back to the top