Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Brodt2014-07-28 16:54:58 -0400
committerBob Brodt2014-07-28 16:54:58 -0400
commite58b73b2ea500a989b7474d34460ebc25716eebf (patch)
tree9331048b4b11c61a5df7b029e0fe15d9e3b49afb
parent347cc4825d3fe3410fa184128b35e13cc3d72536 (diff)
downloadorg.eclipse.bpmn2-modeler-e58b73b2ea500a989b7474d34460ebc25716eebf.tar.gz
org.eclipse.bpmn2-modeler-e58b73b2ea500a989b7474d34460ebc25716eebf.tar.xz
org.eclipse.bpmn2-modeler-e58b73b2ea500a989b7474d34460ebc25716eebf.zip
Disable Live Validation after CreateFeature execution to allow
CompounCreateFeatures to complete succesfully.
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java2
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java20
2 files changed, 21 insertions, 1 deletions
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java
index fdbe700b..50a58ea8 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/BendpointConnectionRouter.java
@@ -15,6 +15,7 @@ package org.eclipse.bpmn2.modeler.core.features;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.bpmn2.modeler.core.di.DIUtils;
import org.eclipse.bpmn2.modeler.core.utils.AnchorSite;
import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil;
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
@@ -241,6 +242,7 @@ public class BendpointConnectionRouter extends DefaultConnectionRouter {
*/
protected void applyRoute(ConnectionRoute route) {
route.apply(ffc, sourceAnchor, targetAnchor);
+ DIUtils.updateDIEdge(ffc);
}
protected AnchorSite getNextAnchorSite(AnchorSite site) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java
index 6c5edc8f..044da3ef 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java
@@ -13,6 +13,8 @@
package org.eclipse.bpmn2.modeler.ui.editor;
+import java.util.Map;
+
import org.eclipse.bpmn2.modeler.core.LifecycleEvent;
import org.eclipse.bpmn2.modeler.core.LifecycleEvent.EventType;
import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl;
@@ -21,11 +23,14 @@ import org.eclipse.bpmn2.modeler.core.validation.ValidationStatusAdapterFactory;
import org.eclipse.core.commands.operations.DefaultOperationHistory;
import org.eclipse.core.commands.operations.OperationHistoryEvent;
import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.transaction.Transaction;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.impl.EMFCommandTransaction;
import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
import org.eclipse.emf.workspace.IWorkspaceCommandStack;
import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
@@ -114,7 +119,20 @@ public class BPMN2EditorUpdateBehavior extends DefaultUpdateBehavior {
// Bpmn2ModelerResourceSetImpl instead of using a ResourceSetImpl.
final ResourceSet resourceSet = new Bpmn2ModelerResourceSetImpl();
final IWorkspaceCommandStack workspaceCommandStack = new GFWorkspaceCommandStackImpl(
- new DefaultOperationHistory());
+ new DefaultOperationHistory()) {
+
+ @Override
+ public EMFCommandTransaction createTransaction(Command command, Map<?, ?> options)
+ throws InterruptedException {
+ // Need to disable Live Validation after a CreateFeature because some of
+ // the CompountCreateFeatures will construct elements that are not valid
+ // until fleshed out by the user. These errors will still be reported
+ // during Batch Validation once the Create operation is complete.
+ ((Map<Object,Object>)options).put(Transaction.OPTION_NO_VALIDATION, Boolean.TRUE);
+ return super.createTransaction(command, options);
+ }
+
+ };
final TransactionalEditingDomainImpl editingDomain = new TransactionalEditingDomainImpl(
new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE),

Back to the top