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
Eclipse UserFriend
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
Eclipse UserFriend
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
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
Eclipse UserFriend
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
Eclipse UserFriend
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: Fri Feb 14 00:46:14 GMT 2025

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

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

Back to the top