IMPORTANT NOTICE:  As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site.   We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site.  We are leaving this site open and active so you can post and hopefully get a response until the migration is complete.   Once complete, the URL  that currently takes you to this site will take you to our new site so your bookmarks will work as always.  Please read the information on a New Login Process

GenDoc Hidden elements

What is the OCL expression in gendoc that would filter out elements on the diagram that are Hidden?

We have a diagram which contains Visible elements but hidden elements within itself. These elements are Components and sub-components within itself. Some are Hidden, others appear on the diagram.

  • context uml::together::Diagram

    self.children->select(not hidden)->union(self.children.children->select((not hidden)and element.oclIsKindOf(uml::together::Node) ))

    will return a list of all non-hidden nodes from current diagram;

    context uml::together::Diagram

    self.children->select(not hidden)

    Will return all top-level visible nodes

    This can't be used as a filter expression, as you need to have a diagram in context; rather it can be used as a 'programmed' iteration scope for iterator nested in diagrams iterator.