Bug 582745 - [Robotics, ROS2] Code generation for ROS 2 fails, if unexpected connectors are present

- Make ActivityUtils more robust.
- Use designer variant of oep.uml.tools.utils (which has new functions to provide
  information about a connector). Use this plugin in MANIFEST, implication on other files
- Remove bad UML connector from dummy_joint_states component (part of dummy_robot example)

Signed-off-by: aradermache <ansgar.radermacher@cea.fr>

Change-Id: I789fad341bd969c848559984a8a8e5ff30c97907
Signed-off-by: aradermache <ansgar.radermacher@cea.fr>
diff --git a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/META-INF/MANIFEST.MF b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/META-INF/MANIFEST.MF
index e4ffae1..ff43099 100644
--- a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/META-INF/MANIFEST.MF
+++ b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/META-INF/MANIFEST.MF
@@ -5,7 +5,6 @@
 Require-Bundle: org.eclipse.ui,
  org.eclipse.papyrus.designer.transformation.core;bundle-version="0.7.0",
  org.eclipse.uml2.uml;bundle-version="4.0.0",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="[3.4.0,5.0.0)",
  org.eclipse.papyrus.infra.core.log;bundle-version="[1.2.0,3.0.0)",
  org.eclipse.core.resources,
  org.eclipse.papyrus.designer.languages.cpp.profile;bundle-version="0.7.0",
diff --git a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/ActivityUtils.xtend b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/ActivityUtils.xtend
index 2a000a4..ea0a40a 100644
--- a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/ActivityUtils.xtend
+++ b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/ActivityUtils.xtend
@@ -14,13 +14,14 @@
 package org.eclipse.papyrus.robotics.codegen.common.utils
 
 import java.util.List
+import org.eclipse.papyrus.designer.transformation.base.utils.TransformationException
+import org.eclipse.papyrus.designer.uml.tools.utils.ConnectorUtil
 import org.eclipse.papyrus.robotics.codegen.common.component.CodeSkeleton
 import org.eclipse.papyrus.robotics.profile.robotics.components.Activity
 import org.eclipse.papyrus.robotics.profile.robotics.components.ActivityPort
 import org.eclipse.papyrus.robotics.profile.robotics.components.ComponentDefinition
 import org.eclipse.papyrus.robotics.profile.robotics.components.PeriodicTimer
 import org.eclipse.papyrus.robotics.profile.robotics.functions.FunctionKind
-import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil
 import org.eclipse.uml2.uml.Class
 import org.eclipse.uml2.uml.Port
 import org.eclipse.uml2.uml.util.UMLUtil
@@ -67,11 +68,16 @@
 					val end1 = connector.ends.get(0);
 					val end2 = connector.ends.get(1);
 					// the connector end targets a port of the nested activity classifier
-					// (not part) => use owner to navigate to owning activity 
-					if (end1.role.owner == activityCl) {
+					// (not part) => use owner to navigate to owning activity
+					if (end1.role == null || end2.role == null) {
+						throw new TransformationException(
+							String.format("Internal connector <%s> to an activity does not target a port",
+								ConnectorUtil.getConnectorInfo(connector)));
+					}
+					if (end1.role !== null && end1.role.owner == activityCl) {
 						return end1.role as Port
 					}
-					if (end2.role.owner == activityCl) {
+					if (end2.role !== null && end2.role.owner == activityCl) {
 						return end2.role as Port;
 					}
 				}
diff --git a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/ComponentUtils.xtend b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/ComponentUtils.xtend
index 2ccd185..b28ed52 100644
--- a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/ComponentUtils.xtend
+++ b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/ComponentUtils.xtend
@@ -16,8 +16,8 @@
 
 import java.util.Collections
 import java.util.List
+import org.eclipse.papyrus.designer.uml.tools.utils.PackageUtil
 import org.eclipse.papyrus.robotics.profile.robotics.components.ComponentDefinitionModel
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil
 import org.eclipse.uml2.uml.Class
 import org.eclipse.uml2.uml.util.UMLUtil
 
diff --git a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/Helpers.java b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/Helpers.java
index 625dc0a..d11acef 100644
--- a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/Helpers.java
+++ b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/Helpers.java
@@ -20,7 +20,7 @@
 import org.eclipse.papyrus.designer.languages.cpp.profile.C_Cpp.Ptr;
 import org.eclipse.papyrus.designer.transformation.core.transformations.TransformationContext;
 import org.eclipse.papyrus.designer.uml.tools.utils.ElementUtils;
-import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.papyrus.designer.uml.tools.utils.StereotypeUtil;
 import org.eclipse.uml2.uml.Element;
 import org.eclipse.uml2.uml.NamedElement;
 import org.eclipse.uml2.uml.Type;
diff --git a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/PackageTools.xtend b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/PackageTools.xtend
index 29e5c4d..fa2d396 100644
--- a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/PackageTools.xtend
+++ b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/PackageTools.xtend
@@ -20,16 +20,16 @@
 import org.eclipse.emf.ecore.resource.Resource
 import org.eclipse.papyrus.designer.transformation.base.utils.TransformationException
 import org.eclipse.papyrus.designer.transformation.core.transformations.TransformationContext
+import org.eclipse.papyrus.designer.uml.tools.utils.PackageUtil
+import org.eclipse.papyrus.designer.uml.tools.utils.StereotypeUtil
 import org.eclipse.papyrus.robotics.core.utils.FileExtensions
 import org.eclipse.papyrus.robotics.core.utils.ScanUtils
 import org.eclipse.papyrus.robotics.profile.robotics.components.ComponentDefinitionModel
 import org.eclipse.papyrus.robotics.profile.robotics.components.SystemComponentArchitectureModel
 import org.eclipse.papyrus.robotics.profile.robotics.services.ServiceDefinitionModel
-import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil
 import org.eclipse.uml2.uml.Class
 import org.eclipse.uml2.uml.Package
 import org.eclipse.uml2.uml.util.UMLUtil
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil
 
 class PackageTools {
 
diff --git a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/TopicUtils.xtend b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/TopicUtils.xtend
index 4fca5db..692cbe6 100644
--- a/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/TopicUtils.xtend
+++ b/plugins/codegen/org.eclipse.papyrus.robotics.codegen.common/src/org/eclipse/papyrus/robotics/codegen/common/utils/TopicUtils.xtend
@@ -14,14 +14,14 @@
  
  package org.eclipse.papyrus.robotics.codegen.common.utils
 
-import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil
+import org.eclipse.papyrus.designer.infra.base.StringConstants
+import org.eclipse.papyrus.designer.uml.tools.utils.ConnectorUtil
 import org.eclipse.uml2.uml.Class
 import org.eclipse.uml2.uml.ConnectorEnd
 import org.eclipse.uml2.uml.Port
 import org.eclipse.uml2.uml.Property
 
 import static extension org.eclipse.papyrus.robotics.core.utils.InteractionUtils.getCommObject
-import org.eclipse.papyrus.designer.infra.base.StringConstants
 
 /**
  * A set of utility functions around port and topic names
diff --git a/plugins/examples/org.eclipse.papyrus.robotics.ros2.examples/models/dummy_robot/models/components/dummy_joint_states.compdef.notation b/plugins/examples/org.eclipse.papyrus.robotics.ros2.examples/models/dummy_robot/models/components/dummy_joint_states.compdef.notation
index a30923f..4a6cf00 100644
--- a/plugins/examples/org.eclipse.papyrus.robotics.ros2.examples/models/dummy_robot/models/components/dummy_joint_states.compdef.notation
+++ b/plugins/examples/org.eclipse.papyrus.robotics.ros2.examples/models/dummy_robot/models/components/dummy_joint_states.compdef.notation
@@ -112,6 +112,14 @@
             <element xsi:nil="true"/>
             <layoutConstraint xmi:type="notation:Bounds" xmi:id="_SuOe5SmVEeyFJJI_sS_fdA" x="254" y="16"/>
           </children>
+          <children xmi:type="notation:Shape" xmi:id="_OLCBgJqKEe6yobVqGRMybg" type="StereotypeComment">
+            <styles xmi:type="notation:TitleStyle" xmi:id="_OLCBgZqKEe6yobVqGRMybg"/>
+            <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OLCBg5qKEe6yobVqGRMybg" name="BASE_ELEMENT">
+              <eObjectValue xmi:type="uml:Class" href="dummy_joint_states.compdef.uml#_yRG0gA-BEeqYjOkV1WinKg"/>
+            </styles>
+            <element xsi:nil="true"/>
+            <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OLCBgpqKEe6yobVqGRMybg" x="254" y="16"/>
+          </children>
           <styles xmi:type="notation:TitleStyle" xmi:id="_wjT19A-BEeqYjOkV1WinKg"/>
           <layoutConstraint xmi:type="notation:Bounds" xmi:id="_wjT19Q-BEeqYjOkV1WinKg"/>
         </children>
@@ -341,6 +349,30 @@
         <element xsi:nil="true"/>
         <layoutConstraint xmi:type="notation:Bounds" xmi:id="_SuTXYimVEeyFJJI_sS_fdA" x="311" y="70"/>
       </children>
+      <children xmi:type="notation:Shape" xmi:id="_OK1NMJqKEe6yobVqGRMybg" type="StereotypeComment">
+        <styles xmi:type="notation:TitleStyle" xmi:id="_OK1NMZqKEe6yobVqGRMybg"/>
+        <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OK1NM5qKEe6yobVqGRMybg" name="BASE_ELEMENT">
+          <eObjectValue xmi:type="uml:Class" href="dummy_joint_states.compdef.uml#_je3uEA9nEeq4SdRfpcPmcg"/>
+        </styles>
+        <element xsi:nil="true"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OK1NMpqKEe6yobVqGRMybg" x="412" y="22"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_OK6s2JqKEe6yobVqGRMybg" type="StereotypeComment">
+        <styles xmi:type="notation:TitleStyle" xmi:id="_OK6s2ZqKEe6yobVqGRMybg"/>
+        <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OK6s25qKEe6yobVqGRMybg" name="BASE_ELEMENT">
+          <eObjectValue xmi:type="uml:Class" href="dummy_joint_states.compdef.uml#_wiQtEA-BEeqYjOkV1WinKg"/>
+        </styles>
+        <element xsi:nil="true"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OK6s2pqKEe6yobVqGRMybg" x="252" y="22"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_OLJ9UJqKEe6yobVqGRMybg" type="StereotypeComment">
+        <styles xmi:type="notation:TitleStyle" xmi:id="_OLJ9UZqKEe6yobVqGRMybg"/>
+        <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OLKkYJqKEe6yobVqGRMybg" name="BASE_ELEMENT">
+          <eObjectValue xmi:type="uml:Port" href="dummy_joint_states.compdef.uml#_K9rJ8BBIEeqWHMMybhfq6w"/>
+        </styles>
+        <element xsi:nil="true"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OLJ9UpqKEe6yobVqGRMybg" x="311" y="70"/>
+      </children>
       <styles xmi:type="notation:TitleStyle" xmi:id="_Xfi1UQ9nEeq4SdRfpcPmcg"/>
       <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Xfi1Ug9nEeq4SdRfpcPmcg"/>
     </children>
@@ -570,6 +602,30 @@
     <element xsi:nil="true"/>
     <layoutConstraint xmi:type="notation:Bounds" xmi:id="_SuchUimVEeyFJJI_sS_fdA" x="569" y="32"/>
   </children>
+  <children xmi:type="notation:Shape" xmi:id="_OKtRYJqKEe6yobVqGRMybg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_OKtRYZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OKtRY5qKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="dummy_joint_states.compdef.uml#_lNhAQA6uEeqas7S1-hM4Zg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OKtRYpqKEe6yobVqGRMybg" x="322" y="98"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_OLTHQJqKEe6yobVqGRMybg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_OLTHQZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OLTHQ5qKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Port" href="dummy_joint_states.compdef.uml#_lXNHwA6uEeqas7S1-hM4Zg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OLTHQpqKEe6yobVqGRMybg" x="569" y="132"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_OLZ08JqKEe6yobVqGRMybg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_OLZ08ZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OLZ085qKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Connector" href="dummy_joint_states.compdef.uml#_xR3doBBIEeqWHMMybhfq6w"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OLZ08pqKEe6yobVqGRMybg" x="569" y="32"/>
+  </children>
   <styles xmi:type="notation:StringValueStyle" xmi:id="_VcNroQ9nEeq4SdRfpcPmcg" name="diagram_compatibility_version" stringValue="1.4.0"/>
   <styles xmi:type="notation:DiagramStyle" xmi:id="_VcNrog9nEeq4SdRfpcPmcg"/>
   <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_VcNrow9nEeq4SdRfpcPmcg" diagramKindId="org.eclipse.papyrus.robotics.diagram.component">
@@ -1228,4 +1284,74 @@
     <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_SuchVymVEeyFJJI_sS_fdA"/>
     <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_SuchWCmVEeyFJJI_sS_fdA"/>
   </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_OKtRZJqKEe6yobVqGRMybg" type="StereotypeCommentLink" source="_XfgZEA9nEeq4SdRfpcPmcg" target="_OKtRYJqKEe6yobVqGRMybg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_OKtRZZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OKtRaZqKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="dummy_joint_states.compdef.uml#_lNhAQA6uEeqas7S1-hM4Zg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OKtRZpqKEe6yobVqGRMybg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OKtRZ5qKEe6yobVqGRMybg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OKtRaJqKEe6yobVqGRMybg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_OK1NNJqKEe6yobVqGRMybg" type="StereotypeCommentLink" source="_jfs0gA9nEeq4SdRfpcPmcg" target="_OK1NMJqKEe6yobVqGRMybg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_OK1NNZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OK1NOZqKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="dummy_joint_states.compdef.uml#_je3uEA9nEeq4SdRfpcPmcg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OK1NNpqKEe6yobVqGRMybg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OK1NN5qKEe6yobVqGRMybg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OK1NOJqKEe6yobVqGRMybg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_OK6s3JqKEe6yobVqGRMybg" type="StereotypeCommentLink" source="_wjTO4A-BEeqYjOkV1WinKg" target="_OK6s2JqKEe6yobVqGRMybg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_OK6s3ZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OK7T0pqKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="dummy_joint_states.compdef.uml#_wiQtEA-BEeqYjOkV1WinKg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OK6s3pqKEe6yobVqGRMybg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OK7T0JqKEe6yobVqGRMybg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OK7T0ZqKEe6yobVqGRMybg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_OLCBhJqKEe6yobVqGRMybg" type="StereotypeCommentLink" source="_ySi-8A-BEeqYjOkV1WinKg" target="_OLCBgJqKEe6yobVqGRMybg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_OLCBhZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OLCBiZqKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="dummy_joint_states.compdef.uml#_yRG0gA-BEeqYjOkV1WinKg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OLCBhpqKEe6yobVqGRMybg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OLCBh5qKEe6yobVqGRMybg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OLCBiJqKEe6yobVqGRMybg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_OLKkYZqKEe6yobVqGRMybg" type="StereotypeCommentLink" source="_K_d5sBBIEeqWHMMybhfq6w" target="_OLJ9UJqKEe6yobVqGRMybg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_OLKkYpqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OLKkZpqKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Port" href="dummy_joint_states.compdef.uml#_K9rJ8BBIEeqWHMMybhfq6w"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OLKkY5qKEe6yobVqGRMybg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OLKkZJqKEe6yobVqGRMybg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OLKkZZqKEe6yobVqGRMybg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_OLTHRJqKEe6yobVqGRMybg" type="StereotypeCommentLink" source="_ZKMZQA9nEeq4SdRfpcPmcg" target="_OLTHQJqKEe6yobVqGRMybg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_OLTHRZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OLTHSZqKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Port" href="dummy_joint_states.compdef.uml#_lXNHwA6uEeqas7S1-hM4Zg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OLTHRpqKEe6yobVqGRMybg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OLTHR5qKEe6yobVqGRMybg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OLTHSJqKEe6yobVqGRMybg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_OLZ09JqKEe6yobVqGRMybg" type="StereotypeCommentLink" source="_xWAWwBBIEeqWHMMybhfq6w" target="_OLZ08JqKEe6yobVqGRMybg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_OLZ09ZqKEe6yobVqGRMybg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_OLZ0-ZqKEe6yobVqGRMybg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Connector" href="dummy_joint_states.compdef.uml#_xR3doBBIEeqWHMMybhfq6w"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OLZ09pqKEe6yobVqGRMybg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OLZ095qKEe6yobVqGRMybg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OLZ0-JqKEe6yobVqGRMybg"/>
+  </edges>
 </notation:Diagram>
diff --git a/plugins/examples/org.eclipse.papyrus.robotics.ros2.examples/models/dummy_robot/models/components/dummy_joint_states.compdef.uml b/plugins/examples/org.eclipse.papyrus.robotics.ros2.examples/models/dummy_robot/models/components/dummy_joint_states.compdef.uml
index 93b3bfb..393578a 100644
--- a/plugins/examples/org.eclipse.papyrus.robotics.ros2.examples/models/dummy_robot/models/components/dummy_joint_states.compdef.uml
+++ b/plugins/examples/org.eclipse.papyrus.robotics.ros2.examples/models/dummy_robot/models/components/dummy_joint_states.compdef.uml
@@ -16,10 +16,6 @@
       <ownedAttribute xmi:type="uml:Property" xmi:id="_7Rf6cBCTEeqpC8wzYJkICg" name="msg" visibility="public">
         <type xmi:type="uml:DataType" href="pathmap://ROS2_LIB_BASE/services/sensor_msgs.servicedef.uml#ID_msg_JointState"/>
       </ownedAttribute>
-      <ownedConnector xmi:type="uml:Connector" xmi:id="_bIhbMBA4EeqWHMMybhfq6w">
-        <end xmi:type="uml:ConnectorEnd" xmi:id="_bIlFkBA4EeqWHMMybhfq6w" role="_lXNHwA6uEeqas7S1-hM4Zg"/>
-        <end xmi:type="uml:ConnectorEnd" xmi:id="_bIlFkRA4EeqWHMMybhfq6w" partWithPort="_wiYB0A-BEeqYjOkV1WinKg"/>
-      </ownedConnector>
       <ownedConnector xmi:type="uml:Connector" xmi:id="_xR3doBBIEeqWHMMybhfq6w">
         <end xmi:type="uml:ConnectorEnd" xmi:id="_xR8WIBBIEeqWHMMybhfq6w" role="_lXNHwA6uEeqas7S1-hM4Zg"/>
         <end xmi:type="uml:ConnectorEnd" xmi:id="_xR8WIRBIEeqWHMMybhfq6w" partWithPort="_wiYB0A-BEeqYjOkV1WinKg" role="_K9rJ8BBIEeqWHMMybhfq6w"/>
@@ -141,7 +137,6 @@
   <robotics.functions:Function xmi:id="_plsnIA_PEeqYjOkV1WinKg" base_Class="_plqK4A_PEeqYjOkV1WinKg" kind="ON_ACTIVATE"/>
   <robotics.functions:Function xmi:id="_qITWMA_VEeqYjOkV1WinKg" base_Class="_qIQ58A_VEeqYjOkV1WinKg" kind="PERIODIC"/>
   <C_Cpp:Include xmi:id="_pUxLAA_WEeqYjOkV1WinKg" header="#include &lt;cmath>&#xA;using namespace std::chrono_literals;&#xA;" base_class="_lNhAQA6uEeqas7S1-hM4Zg" base_Classifier="_lNhAQA6uEeqas7S1-hM4Zg"/>
-  <robotics.generics:Connects xmi:id="_bIlFkhA4EeqWHMMybhfq6w" base_Connector="_bIhbMBA4EeqWHMMybhfq6w"/>
   <robotics.components:ActivityPort xmi:id="_K9u0UBBIEeqWHMMybhfq6w" base_Port="_K9rJ8BBIEeqWHMMybhfq6w"/>
   <robotics.generics:Connects xmi:id="_xR89MBBIEeqWHMMybhfq6w" base_Connector="_xR3doBBIEeqWHMMybhfq6w"/>
   <robotics.parameters:ParameterEntry xmi:id="_4kAz8BCoEeqpC8wzYJkICg" base_Property="_3tBhkBCoEeqpC8wzYJkICg"/>