]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Diagram mapping should remove connections alongside elements 68/2768/1
authorjsimomaa <jani.simomaa@gmail.com>
Wed, 6 Mar 2019 12:58:51 +0000 (14:58 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 12 Mar 2019 12:36:55 +0000 (12:36 +0000)
gitlab #269

Change-Id: Ib848eb96f6f61093fc76dac3c49983e3febc3595
(cherry picked from commit 30fd51fd1b062f3ce0bd470cfee097c34ae4500b)

bundles/org.simantics.modeling/src/org/simantics/modeling/mapping/DiagramToCompositeMapping3.java

index 783084565ad850dfe8e3827f6bc8398b0dcebc67..f9feea9e28e532d529423b8bedb4a39636adb8c6 100644 (file)
@@ -195,14 +195,20 @@ public class DiagramToCompositeMapping3 extends MappingBase {
                                 destructiveConnectionRule()
                             ),
                             // If component does not have a corresponding element in the diagram, remove it
-                            and(deny(b(new Tag(MOD.ComponentToElement), Component)), deny(exists(Component)))
+                            and(
+                                    deny(b(new Tag(MOD.ComponentToElement), Component)),
+                                    deny(b(new Tag(STR.IsConnectedTo), Component)),
+                                    deny(exists(Component)))
                         )
                     )
                 ),
                 if_(b(mappedFromConnector, Component), // handle only mapped components
                     query(
                         unless(bf(MOD.ComponentToConnector, Component, Connector),
-                            and(deny(b(new Tag(MOD.ComponentToElement), Component)), deny(exists(Component)))
+                            and(
+                                    deny(b(new Tag(MOD.ComponentToElement), Component)),
+                                    deny(b(new Tag(STR.IsConnectedTo), Component)),
+                                    deny(exists(Component)))
                         )
                     )
                 )