#-------------------------------------------------------------------------------
# Copyright (c) 2006, 2015 THALES GLOBAL SERVICES.
#  All rights reserved. This program and the accompanying materials
#  are made available under the terms of the Eclipse Public License v1.0
#  which accompanies this distribution, and is available at
#  http://www.eclipse.org/legal/epl-v10.html
#    
#  Contributors:
#     Thales - initial API and implementation
#-------------------------------------------------------------------------------
#
# When selecting an EPackage:
#

# all semantic types
self.eClassifiers->select(x | x.getEAnnotation('http://www.polarsys.org/simplifiedM2/Semantic') <> null)

# all navigable derived references with an abstract type
self.eClassifiers->select(x | x.oclIsTypeOf(ecore::EClass))->collect( x | x.oclAsType(ecore::EClass).eReferences)->select( x | (x.getEAnnotation('http://www.polarsys.org/simplifiedM2/Navigable') <> null) and x.eType.oclAsType(ecore::EClass).abstract and x.derived)


#
# When selecting a genmodel
#

# All EClassifiers
self.genPackages->union(self.usedGenPackages)->collect(x | x.ecorePackage)->collect(x | x.eClassifiers)

# All EClasses
self.genPackages->union(self.usedGenPackages)->collect(x | x.ecorePackage)->collect(x | x.eClassifiers)->select( x | x.oclIsTypeOf(ecore::EClass))

# All 'semantic' classifiers
self.genPackages->union(self.usedGenPackages)->collect(x | x.ecorePackage)->collect(x | x.eClassifiers)->select( x | x.getEAnnotation('http://www.polarsys.org/simplifiedM2/Semantic') <> null)

# All 'navigable' references
self.genPackages->union(self.usedGenPackages)->collect(x | x.ecorePackage)->collect(x | x.eClassifiers)->select(x | x.oclIsTypeOf(ecore::EClass))->collect(x | x.oclAsType(ecore::EClass).eReferences)->select(x | x.getEAnnotation('http://www.polarsys.org/simplifiedM2/Navigable') <> null)->collect(x | x.eContainingClass.name + '.' + x.name + ':' + x.eType.name)

self.genPackages->union(self.usedGenPackages)->collect(x | x.ecorePackage)->collect(x | x.eClassifiers)->select(x | x.oclIsTypeOf(ecore::EClass))->collect(x | x.oclAsType(ecore::EClass).eReferences)->select(x | (x.getEAnnotation('http://www.polarsys.org/simplifiedM2/Navigable') <> null) and x.derived and x.eReferenceType.abstract)->collect(x | x.eContainingClass.name + '.' + x.name + ':' + x.eType.name)
