Fixed route graph splitting and diagram mapping race condition problem 64/4364/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 21 Aug 2020 13:06:50 +0000 (16:06 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 21 Aug 2020 13:24:15 +0000 (13:24 +0000)
commitb643293df21959d6416d0ba42637419c33a1dbad
tree639cc1ac223b2c947a53429ce371134655dc288a
parent617b9475710b80a125597f222f9777224972ce72
Fixed route graph splitting and diagram mapping race condition problem

RouteGraphConnectionSplitter.doSplit now always splits the connection so
that part #1 is always the part that stays with the existing diagram
connection and part #2 contains the entities that are moved to the newly
created route graph connection resource. Part #1 is the part where the
"output terminal" attached to the connection lies. This simplifies and
clarifies the implementation of doSplit and does not require moving
diagram mapping statements around.

Also, more importantly RouteGraphConnectionSplitter and FlagUtil changes
ensure that diagram mapping is *not* executed in FlagUtil.join, which
was the main cause of the previous corruption. Diagram mapping is only
activated once for the affected diagram(s) after everything else is
done.

gitlab #549
gitlab #586

Change-Id: Icf7479e8e111bf663f637d6909419267cfa4eec4
(cherry picked from commit cc78488e2230fea07726acb86db3c7dd245b39ce)
bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/RouteLine.java
bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/segments/Segment.java
bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/splitting/SplittedRouteGraph.java
bundles/org.simantics.diagram/src/org/simantics/diagram/flag/FlagUtil.java
bundles/org.simantics.diagram/src/org/simantics/diagram/flag/RouteGraphConnectionSplitter.java
bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/RouteGraphModification.java