| commit | d556bd61b95fec7945204485c06ddb6a9790a5ea | [log] [tgz] |
|---|---|---|
| author | Ansgar Radermacher <ansgar.radermacher@cea.fr> | Tue Apr 18 16:54:32 2023 -0400 |
| committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | Tue Apr 18 16:54:32 2023 -0400 |
| tree | bd0f92e35569b3c8303b3063181a20d4293b5df1 | |
| parent | 9e7a3174a5d0778ff67e6dadb2a5b69e4d82699f [diff] | |
| parent | a8e1798fa97f0b039eb3a4a7fded0fc61cc3e906 [diff] |
Merge "Bug 581597 - [Robotics, ROS2] Support callback groups"
diff --git a/plugins/ros2/org.eclipse.papyrus.robotics.ros2.codegen.common/src/org/eclipse/papyrus/robotics/ros2/codegen/common/component/CallbackGroups.xtend b/plugins/ros2/org.eclipse.papyrus.robotics.ros2.codegen.common/src/org/eclipse/papyrus/robotics/ros2/codegen/common/component/CallbackGroups.xtend index 17ab42b..651f61b 100644 --- a/plugins/ros2/org.eclipse.papyrus.robotics.ros2.codegen.common/src/org/eclipse/papyrus/robotics/ros2/codegen/common/component/CallbackGroups.xtend +++ b/plugins/ros2/org.eclipse.papyrus.robotics.ros2.codegen.common/src/org/eclipse/papyrus/robotics/ros2/codegen/common/component/CallbackGroups.xtend
@@ -17,13 +17,18 @@ import org.eclipse.uml2.uml.Port import org.eclipse.uml2.uml.Class import static extension org.eclipse.papyrus.robotics.codegen.common.utils.ActivityUtils.* +import org.eclipse.papyrus.designer.transformation.base.utils.TransformationException class CallbackGroups { /** * name of a callback group for a port (which is connected to an activity) */ def static callbackGroupName(Port port) { - return port.class_.getActivity(port).callbackGroupName + val activity = port.class_.getActivity(port) + if (activity === null) { + throw new TransformationException(String.format("no activity is associated with port '%s' => cannot determine callback group", port.name)) + } + return activity.callbackGroupName } /**