[ZB 271] getAllRTPorts not returning the list of all inherited ports

The translator to xtumlrt was ignoring generalization relations.
Previously it assumed that the 'redefinedElements' list of the UML
Element contained the generalized element, but that's not the case for
classifiers.

This patch explicitly fixes that in the translator.

Change-Id: Idb09b615f901c575b436a5b4dd69b75e64aab5d3
Signed-off-by: Ernesto Posse <eposse@gmail.com>
diff --git a/codegen/org.eclipse.papyrusrt.codegen.xtumlrt.trans/src/org/eclipse/papyrusrt/codegen/xtumlrt/trans/UML2xtumlrtModelTranslator.xtend b/codegen/org.eclipse.papyrusrt.codegen.xtumlrt.trans/src/org/eclipse/papyrusrt/codegen/xtumlrt/trans/UML2xtumlrtModelTranslator.xtend
index 0e24ea7..0a73974 100644
--- a/codegen/org.eclipse.papyrusrt.codegen.xtumlrt.trans/src/org/eclipse/papyrusrt/codegen/xtumlrt/trans/UML2xtumlrtModelTranslator.xtend
+++ b/codegen/org.eclipse.papyrusrt.codegen.xtumlrt.trans/src/org/eclipse/papyrusrt/codegen/xtumlrt/trans/UML2xtumlrtModelTranslator.xtend
@@ -271,6 +271,24 @@
         }
     }
 
+    protected def translateGeneralization
+    (
+        org.eclipse.uml2.uml.Class element,
+        RedefinableElement newElement
+    )
+    {
+        if (element.generals !== null && !element.generals.empty)
+        {
+            var org.eclipse.uml2.uml.Class superClass = null
+            if (element.isCapsule)
+                superClass = element.generals.findFirst[ it.isCapsule ] as org.eclipse.uml2.uml.Class
+            else
+                superClass = element.generals.get(0) as org.eclipse.uml2.uml.Class
+            if (superClass !== null)
+                newElement.redefines = translate( superClass ) as RedefinableElement
+        }
+    }
+
     protected def translateMultiplicityElement
     (
         org.eclipse.uml2.uml.MultiplicityElement element,
@@ -506,6 +524,7 @@
 
     protected def translateBasicClass( org.eclipse.uml2.uml.Class klass, Entity newClass )
     {
+        translateGeneralization( klass, newClass )
         for (attribute : klass.ownedAttributes)
         {
             if (!attribute.isRTPort && !attribute.isCapsulePart)
@@ -529,7 +548,6 @@
     {
         val it = CommonFactory.eINSTANCE.createCapsule
         translateBasicClass( klass, it )
-        translateRedefinableElement( klass, it )
         for (part : klass.capsuleParts)
         {
             parts.add( translate(part) as CapsulePart )
diff --git a/codegen/org.eclipse.papyrusrt.xtumlrt.common.model/model/common.ecore b/codegen/org.eclipse.papyrusrt.xtumlrt.common.model/model/common.ecore
index 96528fc..0ad6c66 100644
--- a/codegen/org.eclipse.papyrusrt.xtumlrt.common.model/model/common.ecore
+++ b/codegen/org.eclipse.papyrusrt.xtumlrt.common.model/model/common.ecore
@@ -71,7 +71,7 @@
     <eLiterals name="OUT" value="1"/>
     <eLiterals name="IN_OUT" value="2"/>
   </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Entity" abstract="true" eSuperTypes="#//Type">
+  <eClassifiers xsi:type="ecore:EClass" name="Entity" abstract="true" eSuperTypes="#//Type #//RedefinableElement">
     <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
         eType="#//Attribute" containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="operations" upperBound="-1"
diff --git a/codegen/org.eclipse.papyrusrt.xtumlrt.common.model/model/representations.aird b/codegen/org.eclipse.papyrusrt.xtumlrt.common.model/model/representations.aird
index 5e3b1ec..6dcc621 100644
--- a/codegen/org.eclipse.papyrusrt.xtumlrt.common.model/model/representations.aird
+++ b/codegen/org.eclipse.papyrusrt.xtumlrt.common.model/model/representations.aird
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style" xmi:id="_8PzooK3lEeSuH7f2GGufnw" selectedViews="_8dHr4K3lEeSuH7f2GGufnw _8fiGsK3lEeSuH7f2GGufnw _8fqCgK3lEeSuH7f2GGufnw _8hIpMK3lEeSuH7f2GGufnw" version="10.0.10.201502231700">
-  <models xmi:type="ecore:EPackage" href="common.ecore#/"/>
-  <models xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/2002/Ecore#/"/>
-  <models xmi:type="ecore:EPackage" href="structure.ecore#/"/>
-  <models xmi:type="ecore:EPackage" href="platform:/resource/org.eclipse.papyrusrt.xtumlrt.transformation.model/model/transformationmodel.ecore#/"/>
+<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style" xmi:id="_8PzooK3lEeSuH7f2GGufnw" selectedViews="_8dHr4K3lEeSuH7f2GGufnw _8fiGsK3lEeSuH7f2GGufnw _8fqCgK3lEeSuH7f2GGufnw _8hIpMK3lEeSuH7f2GGufnw" version="11.0.0.201503202000">
+  <semanticResources>platform:/resource/org.eclipse.papyrusrt.xtumlrt.common.model/model/common.ecore</semanticResources>
+  <semanticResources>http://www.eclipse.org/emf/2002/Ecore</semanticResources>
+  <semanticResources>platform:/resource/org.eclipse.papyrusrt.xtumlrt.common.model/model/structure.ecore</semanticResources>
+  <semanticResources>platform:/resource/org.eclipse.papyrusrt.xtumlrt.transformation.model/model/transformationmodel.ecore</semanticResources>
   <ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_8dHr4K3lEeSuH7f2GGufnw" initialized="true">
     <ownedRepresentations xmi:type="diagram:DSemanticDiagram" xmi:id="__ADisK3lEeSuH7f2GGufnw" name="xtUMLrt Common">
       <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="__AEJwK3lEeSuH7f2GGufnw" source="GMF_DIAGRAMS">
@@ -2139,6 +2139,22 @@
             <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_obHz8PW0EeScDf7MYTU8VA" id="(0.0,0.5454545454545454)"/>
             <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_obHz8fW0EeScDf7MYTU8VA" id="(1.0,0.2727272727272727)"/>
           </edges>
+          <edges xmi:type="notation:Edge" xmi:id="_18IaIP8xEeSeUKfv-iQI7w" type="4001" element="_17oD0P8xEeSeUKfv-iQI7w" source="_McL-Y63rEeSuH7f2GGufnw" target="_McEpoK3rEeSuH7f2GGufnw">
+            <children xmi:type="notation:Node" xmi:id="_18ip0P8xEeSeUKfv-iQI7w" type="6001">
+              <layoutConstraint xmi:type="notation:Bounds" xmi:id="_18ip0f8xEeSeUKfv-iQI7w" y="-10"/>
+            </children>
+            <children xmi:type="notation:Node" xmi:id="_18j38P8xEeSeUKfv-iQI7w" type="6002">
+              <layoutConstraint xmi:type="notation:Bounds" xmi:id="_18j38f8xEeSeUKfv-iQI7w" y="10"/>
+            </children>
+            <children xmi:type="notation:Node" xmi:id="_18lGEP8xEeSeUKfv-iQI7w" type="6003">
+              <layoutConstraint xmi:type="notation:Bounds" xmi:id="_18lGEf8xEeSeUKfv-iQI7w" y="10"/>
+            </children>
+            <styles xmi:type="notation:ConnectorStyle" xmi:id="_18IaIf8xEeSeUKfv-iQI7w" routing="Tree"/>
+            <styles xmi:type="notation:FontStyle" xmi:id="_18IaIv8xEeSeUKfv-iQI7w" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
+            <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_18IaI_8xEeSeUKfv-iQI7w" points="[1413, 139, 1413, 139]$[2502, -316, 2502, -316]"/>
+            <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_18pXgP8xEeSeUKfv-iQI7w" id="(0.03333333333333333,0.42)"/>
+            <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_18pXgf8xEeSeUKfv-iQI7w" id="(0.025,0.35)"/>
+          </edges>
         </data>
       </ownedAnnotationEntries>
       <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_MbHAUK3rEeSuH7f2GGufnw" source="DANNOTATION_CUSTOMIZATION_KEY">
@@ -2181,7 +2197,7 @@
           </computedStyleDescriptions>
         </data>
       </ownedAnnotationEntries>
-      <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_MZugQK3rEeSuH7f2GGufnw" name="RedefinableElement" tooltipText="" outgoingEdges="_MbFLIK3rEeSuH7f2GGufnw _VfLu8LkaEeS1iuOpNDUtkg" incomingEdges="_MbFLIK3rEeSuH7f2GGufnw _MbuEUK3rEeSuH7f2GGufnw _Yr4OkLCBEeS2zc2JFFVtPw _lGeuELCBEeS2zc2JFFVtPw _mC1ooLCBEeS2zc2JFFVtPw _n5tDoLCBEeS2zc2JFFVtPw _qj0ggLCBEeS2zc2JFFVtPw _sC8J4LCBEeS2zc2JFFVtPw" width="12" height="10">
+      <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_MZugQK3rEeSuH7f2GGufnw" name="RedefinableElement" tooltipText="" outgoingEdges="_MbFLIK3rEeSuH7f2GGufnw _VfLu8LkaEeS1iuOpNDUtkg" incomingEdges="_MbFLIK3rEeSuH7f2GGufnw _MbuEUK3rEeSuH7f2GGufnw _Yr4OkLCBEeS2zc2JFFVtPw _lGeuELCBEeS2zc2JFFVtPw _mC1ooLCBEeS2zc2JFFVtPw _n5tDoLCBEeS2zc2JFFVtPw _qj0ggLCBEeS2zc2JFFVtPw _sC8J4LCBEeS2zc2JFFVtPw _17oD0P8xEeSeUKfv-iQI7w" width="12" height="10">
         <target xmi:type="ecore:EClass" href="common.ecore#//RedefinableElement"/>
         <semanticElements xmi:type="ecore:EClass" href="common.ecore#//RedefinableElement"/>
         <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
@@ -2357,7 +2373,7 @@
           <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
         </ownedElements>
       </ownedDiagramElements>
-      <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_MZ1N8K3rEeSuH7f2GGufnw" name="Entity" tooltipText="" outgoingEdges="_MbLRxq3rEeSuH7f2GGufnw _MbL43K3rEeSuH7f2GGufnw _MbNG8K3rEeSuH7f2GGufnw _CElHALCAEeS2zc2JFFVtPw" incomingEdges="_MburZq3rEeSuH7f2GGufnw _HzYAYLCBEeS2zc2JFFVtPw _eGpJgLhVEeSH9PQiHQ6eWw" width="12" height="10">
+      <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_MZ1N8K3rEeSuH7f2GGufnw" name="Entity" tooltipText="" outgoingEdges="_MbLRxq3rEeSuH7f2GGufnw _MbL43K3rEeSuH7f2GGufnw _MbNG8K3rEeSuH7f2GGufnw _CElHALCAEeS2zc2JFFVtPw _17oD0P8xEeSeUKfv-iQI7w" incomingEdges="_MburZq3rEeSuH7f2GGufnw _HzYAYLCBEeS2zc2JFFVtPw _eGpJgLhVEeSH9PQiHQ6eWw" width="12" height="10">
         <target xmi:type="ecore:EClass" href="common.ecore#//Entity"/>
         <semanticElements xmi:type="ecore:EClass" href="common.ecore#//Entity"/>
         <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
@@ -3384,6 +3400,7 @@
       <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_CElHALCAEeS2zc2JFFVtPw" sourceNode="_MZ1N8K3rEeSuH7f2GGufnw" targetNode="_MZzYwK3rEeSuH7f2GGufnw">
         <target xmi:type="ecore:EClass" href="common.ecore#//Entity"/>
         <semanticElements xmi:type="ecore:EGenericType" href="common.ecore#//Entity/@eGenericSuperTypes.0"/>
+        <semanticElements xmi:type="ecore:EGenericType" href="common.ecore#//Entity/@eGenericSuperTypes.1"/>
         <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_CEmVILCAEeS2zc2JFFVtPw" lineStyle="dash" targetArrow="InputClosedArrow" routingStyle="tree">
           <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']/@conditionnalStyles.0/@style"/>
           <beginLabelStyle xmi:type="diagram:BeginLabelStyle" xmi:id="_CEmVIrCAEeS2zc2JFFVtPw" labelFormat="italic" showIcon="false"/>
@@ -3945,6 +3962,17 @@
         </ownedStyle>
         <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
       </ownedDiagramElements>
+      <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_17oD0P8xEeSeUKfv-iQI7w" sourceNode="_MZ1N8K3rEeSuH7f2GGufnw" targetNode="_MZugQK3rEeSuH7f2GGufnw">
+        <target xmi:type="ecore:EClass" href="common.ecore#//Entity"/>
+        <semanticElements xmi:type="ecore:EGenericType" href="common.ecore#//Entity/@eGenericSuperTypes.0"/>
+        <semanticElements xmi:type="ecore:EGenericType" href="common.ecore#//Entity/@eGenericSuperTypes.1"/>
+        <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_17oq4P8xEeSeUKfv-iQI7w" targetArrow="InputClosedArrow" routingStyle="tree">
+          <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']/@style"/>
+          <beginLabelStyle xmi:type="diagram:BeginLabelStyle" xmi:id="_17oq4f8xEeSeUKfv-iQI7w" labelFormat="italic" showIcon="false"/>
+          <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_17oq4v8xEeSeUKfv-iQI7w" showIcon="false"/>
+        </ownedStyle>
+        <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/>
+      </ownedDiagramElements>
       <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
       <filterVariableHistory xmi:type="diagram:FilterVariableHistory" xmi:id="__ADita3lEeSuH7f2GGufnw"/>
       <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/>