From 30fd51fd1b062f3ce0bd470cfee097c34ae4500b Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Wed, 6 Mar 2019 14:58:51 +0200 Subject: [PATCH] Diagram mapping should remove connections alongside elements gitlab #269 Change-Id: Ib848eb96f6f61093fc76dac3c49983e3febc3595 --- .../modeling/mapping/DiagramToCompositeMapping3.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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))) ) ) ) -- 2.47.1