Diagram mapping should remove connections alongside elements 50/2750/1
authorjsimomaa <jani.simomaa@gmail.com>
Wed, 6 Mar 2019 12:58:51 +0000 (14:58 +0200)
committerjsimomaa <jani.simomaa@gmail.com>
Wed, 6 Mar 2019 12:58:51 +0000 (14:58 +0200)
gitlab #269

Change-Id: Ib848eb96f6f61093fc76dac3c49983e3febc3595

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)))
                         )
                     )
                 )