From: jsimomaa Date: Wed, 6 Mar 2019 12:58:51 +0000 (+0200) Subject: Diagram mapping should remove connections alongside elements X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=d61c60ec63677ceb7d815ce914ff0456502b0dd2;p=simantics%2Fplatform.git Diagram mapping should remove connections alongside elements gitlab #269 Change-Id: Ib848eb96f6f61093fc76dac3c49983e3febc3595 (cherry picked from commit 30fd51fd1b062f3ce0bd470cfee097c34ae4500b) --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/mapping/DiagramToCompositeMapping3.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/mapping/DiagramToCompositeMapping3.java index 783084565..f9feea9e2 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/mapping/DiagramToCompositeMapping3.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/mapping/DiagramToCompositeMapping3.java @@ -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))) ) ) )