Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » Filtering in if commands
Filtering in if commands [message #1742092] Wed, 31 August 2016 10:58 Go to next message
Bernd Zeuner is currently offline Bernd ZeunerFriend
Messages: 14
Registered: July 2009
Junior Member
I want to list all classes that are contained in the package "AirInterface" and use the following command:
[if (cl.qualifiedName.contains('AirInterface'))]<drop/>

Unfortunately this if command returns also classes that are contained in "AirInterfaceHsb" and "AirInterfaceDiversity" packages.

Is there a way to restrict the query to the package "AirInterface" only?
Re: Filtering in if commands [message #1742097 is a reply to message #1742092] Wed, 31 August 2016 12:10 Go to previous messageGo to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 69
Registered: July 2014
Member
There are several solutions. Here is one of them:

Package.allInstances()->any(name="AirInterface").ownedElement->select(oclIsKindOf(Class))

Note this query will return classes directly owned by the package, if you want to include those contained in its subpackages as well, just replace "owndElement" by "allOwnedElements()"

Yves


Yves
Re: Filtering in if commands [message #1742254 is a reply to message #1742097] Thu, 01 September 2016 07:09 Go to previous messageGo to next message
Bernd Zeuner is currently offline Bernd ZeunerFriend
Messages: 14
Registered: July 2009
Junior Member
Hallo Yves,

Thank you very much for your quick response.

I'm not able to insert the query you provided into my script; always get error messages.

Here my current script:

[for (cl:Class | Class.allInstances()->sortedBy(name))]<drop/>
[if (cl.qualifiedName.contains('AirInterface'))]<drop/>
[cl.insertClasses()/]
[/if]<drop/>
[/for]<drop/>

Can you please insert your query at the right position into my script.

Btw. I found out, that the term AirInterface needs to be surrounded by single quotes; not double quotes.

Regards
Bernd

Re: Filtering in if commands [message #1742963 is a reply to message #1742254] Thu, 08 September 2016 22:22 Go to previous message
Bernd Zeuner is currently offline Bernd ZeunerFriend
Messages: 14
Registered: July 2009
Junior Member
Hallo Yves,

It's working now Smile
No need to reply to my previous post.
Thank you again.

Regards
Bernd
Previous Topic:Gendoc and submodel
Next Topic:generating doc from Papyrus model :evaluate the body of an OpaqueBehavior fails
Goto Forum:
  


Current Time: Sat Sep 22 04:52:32 GMT 2018

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

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

Back to the top