Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » looking for sample code...
looking for sample code... [message #1760171] Mon, 24 April 2017 08:45 Go to next message
samuel kallmeyer is currently offline samuel kallmeyerFriend
Messages: 47
Registered: March 2017
Member
Hello,
I didn't find yet a sample template which describes how to loop within a requirement diagram, collect the requirement and generate verification matrix from the VerifiedBy...

I started with this (d is the diagram)

[if (clean(d.name) = 'TestRequirements')]
[for (r:Requirement | d.getElementsInDiagram()->filter(Requirement))]<drop/>
FOUND A REQUIREMENT
[r.getId()/]
[/for] <drop/>
[/if] <drop/>

It seems that the list is empty Sad
Based on acceleo coding, is there documentation available for this ?

Thanks,

Samuel
Re: looking for sample code... [message #1760700 is a reply to message #1760171] Tue, 02 May 2017 07:52 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hello
this operation could be performed using Gendoc but SysML is a UML profile that's why in this case you can't find "Requirements"

can you try :
[if (clean(d.name) = 'TestRequirements')]
[for (r:uml::Class| d.getElementsInDiagram()->filter(uml::Class))]<drop/>
FOUND A REQUIREMENT
[r.name/]
[/for] <drop/>
[/if] <drop/>

and

[if (clean(d.name) = 'TestRequirements')]
[for (r:uml::Class| d.getElementsInDiagram()->filter(uml::Class))]<drop/>
FOUND A REQUIREMENT
[r.name/]
[r.getStereotypeApplications()->first().oclAsType(Requirement).id/]
[/for] <drop/>
[/if] <drop/>




Re: looking for sample code... [message #1760747 is a reply to message #1760700] Tue, 02 May 2017 15:00 Go to previous messageGo to next message
samuel kallmeyer is currently offline samuel kallmeyerFriend
Messages: 47
Registered: March 2017
Member
Hello Tristan,
Thanks for this help, I will check therefore eclipse uml classes description to see what I can get from where...
Your first hint works as expected (without Requirement filtering) and returns all Requirements, Activities, ... from the Diagram, that are derived from uml::Class.
The [r.getStereotypeApplications()->first().oclAsType(Requirement).id/] code returns an error:
See details.
The execution of a script failed: Error during generation of Gendoc script :Cannot find operation (first()) for the type (Set(EObject))
Image with id '[d.getDiagram()/]' cannot be found. TIP: Check script used inside the attribute 'object' of <image> tags. Brackets may be missing.
I didn't fully investigate yet.
Re: looking for sample code... [message #1760802 is a reply to message #1760747] Wed, 03 May 2017 07:50 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Sorry I have typed the commands without IDE :s

So can you test this ?
[if (clean(d.name) = 'TestRequirements')]
[for (r:uml::Class| d.getElementsInDiagram()->select(oclIsTypeOf(uml::Class).oclAsType(uml::Class))<drop/>
FOUND A REQUIREMENT
[r.name/]
[/for] <drop/>
[/if] <drop/>

and

[if (clean(d.name) = 'TestRequirements')]
[for (r:uml::Class| d.getElementsInDiagram()->select(oclIsTypeOf(uml::Class).oclAsType(uml::Class))<drop/>
FOUND A REQUIREMENT
[r.name/]
[r.getStereotypeApplications()->asSequence()->first().oclAsType(Requirement).id/]
[/for] <drop/>
[/if] <drop/>




Re: looking for sample code... [message #1760897 is a reply to message #1760802] Thu, 04 May 2017 07:44 Go to previous message
samuel kallmeyer is currently offline samuel kallmeyerFriend
Messages: 47
Registered: March 2017
Member
The [r.getStereotypeApplications()->asSequence()->first().oclAsType(Requirement).id/] is ok.
Tx
Previous Topic:<richText> tag
Next Topic:element first occurence page number
Goto Forum:
  


Current Time: Fri Apr 19 18:52:33 GMT 2024

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

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

Back to the top