Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 23 files changed
  • 0 commit comments
  • 2 contributors
Showing with 208 additions and 38 deletions.
  1. +31 −15 org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandler.java
  2. +111 −0 org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIImport.java
  3. +2 −1  org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIUtils.java
  4. +5 −2 org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmnAddFeature.java
  5. +3 −1 ...clipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractCreateFlowElementFeature.java
  6. +3 −1 ...e.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/data/AbstractCreateRootElementFeature.java
  7. +5 −2 org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractCreateFlowFeature.java
  8. +3 −1 ...lipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToLaneFeature.java
  9. +3 −1 ...pmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToParticipantFeature.java
  10. +3 −1 org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToLaneFeature.java
  11. +3 −1 ...e.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToParticipantFeature.java
  12. +3 −1 ...pmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToDiagramFeature.java
  13. +3 −1 ...e.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToLaneFeature.java
  14. +3 −1 ....modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToParticipantFeature.java
  15. +3 −1 ...clipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/artifact/CreateTextAnnotationFeature.java
  16. +3 −1 org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/artifact/GroupFeatureContainer.java
  17. +3 −1 ...ipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/CreateConversationFeature.java
  18. +3 −1 org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataInputFeatureContainer.java
  19. +3 −1 org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataOutputFeatureContainer.java
  20. +3 −1 ...pse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataStoreReferenceFeatureContainer.java
  21. +3 −1 org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventCreateFeature.java
  22. +3 −1 ....modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CancelEventDefinitionContainer.java
  23. +3 −1 ...eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/ImprovedAdvancedPropertiesComposite.java
View
46 org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandler.java
@@ -40,6 +40,7 @@
import org.eclipse.bpmn2.di.BPMNDiagram;
import org.eclipse.bpmn2.di.BPMNEdge;
import org.eclipse.bpmn2.di.BPMNShape;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.features.BusinessObjectUtil;
import org.eclipse.bpmn2.util.Bpmn2ResourceImpl;
import org.eclipse.dd.di.DiagramElement;
@@ -72,11 +73,14 @@ void createDefinitionsIfMissing() {
if (domain != null) {
final DocumentRoot docRoot = FACTORY.createDocumentRoot();
final Definitions definitions = FACTORY.createDefinitions();
- definitions.setId(EcoreUtil.generateUUID());
+// definitions.setId(EcoreUtil.generateUUID());
+ DIImport.setID(definitions,resource);
Collaboration collaboration = FACTORY.createCollaboration();
- collaboration.setId(EcoreUtil.generateUUID());
+// collaboration.setId(EcoreUtil.generateUUID());
+ DIImport.setID(collaboration,resource);
Participant participant = FACTORY.createParticipant();
- participant.setId(EcoreUtil.generateUUID());
+// participant.setId(EcoreUtil.generateUUID());
+ DIImport.setID(participant,resource);
participant.setName("Internal");
collaboration.getParticipants().add(participant);
definitions.getRootElements().add(collaboration);
@@ -149,7 +153,8 @@ private InputOutputSpecification getOrCreateIOSpecification(Object target) {
Process process = getOrCreateProcess(getParticipant(target));
if (process.getIoSpecification() == null) {
InputOutputSpecification ioSpec = FACTORY.createInputOutputSpecification();
- ioSpec.setId(EcoreUtil.generateUUID());
+// ioSpec.setId(EcoreUtil.generateUUID());
+ DIImport.setID(ioSpec,resource);
process.setIoSpecification(ioSpec);
}
return process.getIoSpecification();
@@ -169,7 +174,8 @@ public void moveFlowNode(FlowNode node, Object source, Object target) {
public Participant addParticipant() {
Collaboration collaboration = getOrCreateCollaboration();
Participant participant = FACTORY.createParticipant();
- participant.setId(EcoreUtil.generateUUID());
+// participant.setId(EcoreUtil.generateUUID());
+ DIImport.setID(participant,resource);
collaboration.getParticipants().add(participant);
return participant;
}
@@ -196,7 +202,8 @@ public void moveLane(Lane movedLane, Participant sourceParticipant, Participant
public Process getOrCreateProcess(Participant participant) {
if (participant.getProcessRef() == null) {
Process process = FACTORY.createProcess();
- process.setId(EcoreUtil.generateUUID());
+// process.setId(EcoreUtil.generateUUID());
+ DIImport.setID(process,resource);
process.setName("Process for " + participant.getName());
getDefinitions().getRootElements().add(process);
participant.setProcessRef(process);
@@ -206,7 +213,8 @@ public Process getOrCreateProcess(Participant participant) {
public Lane createLane(Lane targetLane) {
Lane lane = FACTORY.createLane();
- lane.setId(EcoreUtil.generateUUID());
+// lane.setId(EcoreUtil.generateUUID());
+ DIImport.setID(lane,resource);
if (targetLane.getChildLaneSet() == null) {
targetLane.setChildLaneSet(ModelHandler.FACTORY.createLaneSet());
@@ -223,20 +231,23 @@ public Lane createLane(Lane targetLane) {
public Lane createLane(Object target) {
Lane lane = FACTORY.createLane();
- lane.setId(EcoreUtil.generateUUID());
+// lane.setId(EcoreUtil.generateUUID());
+ DIImport.setID(lane,resource);
FlowElementsContainer container = getFlowElementContainer(target);
if (container.getLaneSets().isEmpty()) {
LaneSet laneSet = FACTORY.createLaneSet();
- laneSet.setId(EcoreUtil.generateUUID());
+// laneSet.setId(EcoreUtil.generateUUID());
container.getLaneSets().add(laneSet);
}
container.getLaneSets().get(0).getLanes().add(lane);
+ DIImport.setID(lane);
return lane;
}
public void laneToTop(Lane lane) {
LaneSet laneSet = FACTORY.createLaneSet();
- laneSet.setId(EcoreUtil.generateUUID());
+// laneSet.setId(EcoreUtil.generateUUID());
+ DIImport.setID(laneSet,resource);
laneSet.getLanes().add(lane);
Process process = getOrCreateProcess(getInternalParticipant());
process.getLaneSets().add(laneSet);
@@ -244,7 +255,8 @@ public void laneToTop(Lane lane) {
public SequenceFlow createSequenceFlow(FlowNode source, FlowNode target) {
SequenceFlow sequenceFlow = FACTORY.createSequenceFlow();
- sequenceFlow.setId(EcoreUtil.generateUUID());
+// sequenceFlow.setId(EcoreUtil.generateUUID());
+ DIImport.setID(sequenceFlow,resource);
addFlowElement(source, sequenceFlow);
sequenceFlow.setSourceRef(source);
@@ -254,7 +266,8 @@ public SequenceFlow createSequenceFlow(FlowNode source, FlowNode target) {
public MessageFlow createMessageFlow(InteractionNode source, InteractionNode target) {
MessageFlow messageFlow = FACTORY.createMessageFlow();
- messageFlow.setId(EcoreUtil.generateUUID());
+// messageFlow.setId(EcoreUtil.generateUUID());
+ DIImport.setID(messageFlow,resource);
messageFlow.setSourceRef(source);
messageFlow.setTargetRef(target);
getOrCreateCollaboration().getMessageFlows().add(messageFlow);
@@ -280,7 +293,8 @@ public Association createAssociation(BaseElement source, BaseElement target) {
}
Association association = FACTORY.createAssociation();
addArtifact(e, association);
- association.setId(EcoreUtil.generateUUID());
+// association.setId(EcoreUtil.generateUUID());
+ DIImport.setID(association,resource);
association.setSourceRef(source);
association.setTargetRef(target);
return association;
@@ -296,7 +310,8 @@ private Collaboration getOrCreateCollaboration() {
}
TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resource);
final Collaboration collaboration = FACTORY.createCollaboration();
- collaboration.setId(EcoreUtil.generateUUID());
+// collaboration.setId(EcoreUtil.generateUUID());
+ DIImport.setID(collaboration,resource);
if (domain != null) {
domain.getCommandStack().execute(new RecordingCommand(domain) {
@@ -311,7 +326,8 @@ protected void doExecute() {
private void addCollaborationToRootElements(final List<RootElement> rootElements, final Collaboration collaboration) {
Participant participant = FACTORY.createParticipant();
- participant.setId(EcoreUtil.generateUUID());
+// participant.setId(EcoreUtil.generateUUID());
+ DIImport.setID(participant,resource);
participant.setName("Internal");
for (RootElement element : rootElements) {
if (element instanceof Process) {
View
111 org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIImport.java
@@ -11,6 +11,7 @@
package org.eclipse.bpmn2.modeler.core.di;
import java.util.HashMap;
+import java.util.Hashtable;
import java.util.List;
import org.eclipse.bpmn2.Association;
@@ -41,7 +42,12 @@
import org.eclipse.dd.dc.Point;
import org.eclipse.dd.di.DiagramElement;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.graphiti.datatypes.ILocation;
@@ -73,6 +79,8 @@
private ModelHandler modelHandler;
private IFeatureProvider featureProvider;
private HashMap<BaseElement, PictogramElement> elements;
+ private static HashMap<ResourceSet, Hashtable<String, EObject>> ids = new HashMap<ResourceSet, Hashtable<String, EObject>>();
+ private static HashMap<String, Integer> defaultIds = new HashMap<String, Integer>();
private final IPeService peService = Graphiti.getPeService();
private final IGaService gaService = Graphiti.getGaService();
@@ -101,6 +109,20 @@ protected void doExecute() {
}
for (BPMNDiagram d : diagrams) {
+ TreeIterator<EObject> iter = d.eAllContents();
+ while (iter.hasNext()) {
+ EObject obj = iter.next();
+ EStructuralFeature feature = ((EObject)obj).eClass().getEStructuralFeature("id");
+ if (feature!=null) {
+ Object value = obj.eGet(feature);
+ if (value!=null) {
+ addID(obj,(String)value);
+ }
+ }
+ }
+ }
+
+ for (BPMNDiagram d : diagrams) {
featureProvider.link(diagram, d);
BPMNPlane plane = d.getPlane();
if (plane.getBpmnElement() == null) {
@@ -416,4 +438,93 @@ private void setAnchorLocation(PictogramElement elem, FixPointAnchor anchor, Poi
anchor.setLocation(p);
}
+
+
+ private static String getObjectName(EObject obj) {
+ String name;
+ EStructuralFeature feature = ((EObject)obj).eClass().getEStructuralFeature("bpmnElement");
+ if (feature!=null) {
+ EObject bpmnElement = (EObject) obj.eGet(feature);
+ name = obj.eClass().getName() + "_" + bpmnElement.eClass().getName();
+ }
+ else {
+ name = obj.eClass().getName();
+ }
+ return name;
+ }
+
+ public static String generateDefaultID(EObject obj) {
+ String name = getObjectName(obj);
+ Integer value = defaultIds.get(name);
+ if (value==null)
+ value = Integer.valueOf(1);
+ value = Integer.valueOf( value.intValue() + 1 );
+ defaultIds.put(name, Integer.valueOf(value));
+
+ return "_" + name + "_" + value;
+ }
+
+ public static String generateID(EObject obj) {
+ return generateID(obj,obj.eResource());
+ }
+
+ public static String generateID(EObject obj, Resource res) {
+ ResourceSet resSet = (res==null || res.getResourceSet()==null) ? null : res.getResourceSet();
+ if (resSet!=null) {
+ Hashtable<String, EObject> tab = ids.get(resSet);
+ if (tab==null) {
+ tab = new Hashtable<String, EObject>();
+ ids.put(resSet, tab);
+ }
+
+ String name = getObjectName(obj);
+ for (int i=1;; ++i) {
+ String id = name + "_" + i;
+ if (tab.get(id)==null) {
+ tab.put(id, obj);
+ return id;
+ }
+ }
+ }
+ return generateDefaultID(obj);
+ }
+
+ private static void addID(EObject obj, String id) {
+ Resource res = obj.eResource();
+ ResourceSet resSet = res.getResourceSet()==null ? null : res.getResourceSet();
+ if (res==null || resSet==null || id.startsWith("_")) {
+ String name = getObjectName(obj);
+ int newValue = 0;
+ try {
+ newValue = Integer.parseInt(id.substring(1));
+ } catch (Exception e) {
+ }
+ Integer oldValue = defaultIds.get(name);
+ if (oldValue==null || newValue > oldValue.intValue())
+ defaultIds.put(name, Integer.valueOf(newValue));
+ }
+ else {
+ Hashtable<String, EObject> tab = ids.get(resSet);
+ if (tab==null) {
+ tab = new Hashtable<String, EObject>();
+ ids.put(resSet, tab);
+ }
+ tab.put(id, obj);
+ }
+ }
+
+ public static void setID(EObject obj) {
+ setID(obj,obj.eResource());
+ }
+
+ public static void setID(EObject obj, Resource res) {
+ EStructuralFeature feature = ((EObject)obj).eClass().getEStructuralFeature("id");
+ if (feature!=null) {
+ obj.eSet(feature, generateID(obj,res));
+ }
+ }
+
+ public void clearIDs(Resource res) {
+
+ }
}
View
3  org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/di/DIUtils.java
@@ -140,7 +140,7 @@ public static BPMNShape createDIShape(Shape shape, BaseElement elem, int x, int
BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;
bpmnShape = BpmnDiFactory.eINSTANCE.createBPMNShape();
- bpmnShape.setId(EcoreUtil.generateUUID());
+// bpmnShape.setId(EcoreUtil.generateUUID());
bpmnShape.setBpmnElement(elem);
Bounds bounds = DcFactory.eINSTANCE.createBounds();
bounds.setX(x);
@@ -151,6 +151,7 @@ public static BPMNShape createDIShape(Shape shape, BaseElement elem, int x, int
List<DiagramElement> elements = bpmnDiagram.getPlane().getPlaneElement();
elements.add(bpmnShape);
+ DIImport.setID(shape);
fp.link(shape, new Object[] { elem, bpmnShape });
break;
View
7 org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractBpmnAddFeature.java
@@ -25,6 +25,7 @@
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.dd.dc.Bounds;
import org.eclipse.dd.dc.DcFactory;
import org.eclipse.dd.dc.Point;
@@ -65,7 +66,7 @@ protected void createDIShape(Shape gShape, BaseElement elem, BPMNShape shape) {
BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;
shape = BpmnDiFactory.eINSTANCE.createBPMNShape();
- shape.setId(EcoreUtil.generateUUID());
+// shape.setId(EcoreUtil.generateUUID());
shape.setBpmnElement(elem);
Bounds bounds = DcFactory.eINSTANCE.createBounds();
if (elem instanceof Activity) {
@@ -79,6 +80,7 @@ protected void createDIShape(Shape gShape, BaseElement elem, BPMNShape shape) {
shape.setBounds(bounds);
addShape(shape, bpmnDiagram);
+ DIImport.setID(shape);
}
}
}
@@ -111,7 +113,7 @@ protected void createDIEdge(Connection connection, BaseElement conElement, BPMNE
BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;
edge = BpmnDiFactory.eINSTANCE.createBPMNEdge();
- edge.setId(EcoreUtil.generateUUID());
+// edge.setId(EcoreUtil.generateUUID());
edge.setBpmnElement(conElement);
if (conElement instanceof Association) {
@@ -145,6 +147,7 @@ protected void createDIEdge(Connection connection, BaseElement conElement, BPMNE
edge.getWaypoint().add(point);
addShape(edge, bpmnDiagram);
+ DIImport.setID(edge);
}
}
}
View
4 ...pse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/AbstractCreateFlowElementFeature.java
@@ -18,6 +18,7 @@
import org.eclipse.bpmn2.Lane;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -46,7 +47,7 @@ public boolean canCreate(ICreateContext context) {
try {
ModelHandler handler = ModelHandler.getInstance(getDiagram());
element = createFlowElement(context);
- element.setId(EcoreUtil.generateUUID());
+// element.setId(EcoreUtil.generateUUID());
if (FeatureSupport.isTargetLane(context) && element instanceof FlowNode) {
((FlowNode) element).getLanes().add(
(Lane) getBusinessObjectForPictogramElement(context.getTargetContainer()));
@@ -57,6 +58,7 @@ public boolean canCreate(ICreateContext context) {
Activator.logError(e);
}
addGraphicalRepresentation(context, element);
+ DIImport.setID(element);
return new Object[] { element };
}
View
4 ...pmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/data/AbstractCreateRootElementFeature.java
@@ -16,6 +16,7 @@
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.ICreateContext;
@@ -39,13 +40,14 @@ public boolean canCreate(ICreateContext context) {
try {
ModelHandler handler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
element = createRootElement();
- element.setId(EcoreUtil.generateUUID());
+// element.setId(EcoreUtil.generateUUID());
handler.addRootElement(element);
} catch (IOException e) {
Activator.logError(e);
}
addGraphicalRepresentation(context, element);
+ DIImport.setID(element);
return new Object[] { element };
}
View
7 ...lipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/flow/AbstractCreateFlowFeature.java
@@ -15,6 +15,7 @@
import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.features.BusinessObjectUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -47,9 +48,11 @@ public Connection create(ICreateConnectionContext context) {
AddConnectionContext addContext = new AddConnectionContext(context.getSourceAnchor(),
context.getTargetAnchor());
BaseElement flow = createFlow(mh, source, target);
- flow.setId(EcoreUtil.generateUUID());
+// flow.setId(EcoreUtil.generateUUID());
addContext.setNewObject(flow);
- return (Connection) getFeatureProvider().addIfPossible(addContext);
+ Connection connection = (Connection) getFeatureProvider().addIfPossible(addContext);
+ DIImport.setID(flow);
+ return connection;
} catch (IOException e) {
Activator.logError(e);
}
View
4 ...se.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToLaneFeature.java
@@ -18,6 +18,7 @@
import org.eclipse.bpmn2.LaneSet;
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -91,8 +92,9 @@ private void modifyModelStructure(Lane targetLane, Lane lane) {
if (targetLane.getChildLaneSet() == null) {
LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
- createLaneSet.setId(EcoreUtil.generateUUID());
+// createLaneSet.setId(EcoreUtil.generateUUID());
targetLane.setChildLaneSet(createLaneSet);
+ DIImport.setID(createLaneSet);
}
List<Lane> lanes = targetLane.getChildLaneSet().getLanes();
View
4 ...2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromDiagramToParticipantFeature.java
@@ -18,6 +18,7 @@
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -78,8 +79,9 @@ private void modifyModelStructure(IMoveShapeContext context) {
Process process = targetParticipant.getProcessRef();
if (process.getLaneSets().isEmpty()) {
LaneSet claneSet = ModelHandler.FACTORY.createLaneSet();
- claneSet.setId(EcoreUtil.generateUUID());
+// claneSet.setId(EcoreUtil.generateUUID());
process.getLaneSets().add(claneSet);
+ DIImport.setID(claneSet);
}
process.getLaneSets().get(0).getLanes().add(movedLane);
}
View
4 ...lipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToLaneFeature.java
@@ -17,6 +17,7 @@
import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -62,8 +63,9 @@ protected void internalMove(IMoveShapeContext context) {
private void modifyModelStructure(Lane sourceLane, Lane targetLane, Lane movedLane) {
if (targetLane.getChildLaneSet() == null) {
LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
- createLaneSet.setId(EcoreUtil.generateUUID());
+// createLaneSet.setId(EcoreUtil.generateUUID());
targetLane.setChildLaneSet(createLaneSet);
+ DIImport.setID(createLaneSet);
}
try {
View
4 ...pmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromLaneToParticipantFeature.java
@@ -18,6 +18,7 @@
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -69,8 +70,9 @@ private void modifyModelStructure(IMoveShapeContext context) {
Process process = targetParticipant.getProcessRef();
if (process.getLaneSets().isEmpty()) {
LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
- createLaneSet.setId(EcoreUtil.generateUUID());
+// createLaneSet.setId(EcoreUtil.generateUUID());
process.getLaneSets().add(createLaneSet);
+ DIImport.setID(createLaneSet);
}
process.getLaneSets().get(0).getLanes().add(movedLane);
View
4 ...2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToDiagramFeature.java
@@ -18,6 +18,7 @@
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -70,8 +71,9 @@ private void modifyModelStructure(IMoveShapeContext context) {
Process process = internalParticipant.getProcessRef();
if (process.getLaneSets().isEmpty()) {
LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
- createLaneSet.setId(EcoreUtil.generateUUID());
+// createLaneSet.setId(EcoreUtil.generateUUID());
process.getLaneSets().add(createLaneSet);
+ DIImport.setID(createLaneSet);
}
process.getLaneSets().get(0).getLanes().add(movedLane);
}
View
4 ...pmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToLaneFeature.java
@@ -17,6 +17,7 @@
import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -87,8 +88,9 @@ private void modifyModelStructure(IMoveShapeContext context) {
if (toLane.getChildLaneSet() == null) {
LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
- createLaneSet.setId(EcoreUtil.generateUUID());
+// createLaneSet.setId(EcoreUtil.generateUUID());
toLane.setChildLaneSet(createLaneSet);
+ DIImport.setID(createLaneSet);
}
toLane.getChildLaneSet().getLanes().add(movedLane);
}
View
4 ...deler.core/src/org/eclipse/bpmn2/modeler/core/features/lane/MoveFromParticipantToParticipantFeature.java
@@ -18,6 +18,7 @@
import org.eclipse.bpmn2.Process;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -90,8 +91,9 @@ private void modifyModelStructure(IMoveShapeContext context) {
Process process = targetParticipant.getProcessRef();
if (process.getLaneSets().isEmpty()) {
LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
- createLaneSet.setId(EcoreUtil.generateUUID());
+// createLaneSet.setId(EcoreUtil.generateUUID());
process.getLaneSets().add(createLaneSet);
+ DIImport.setID(createLaneSet);
}
process.getLaneSets().get(0).getLanes().add(movedLane);
}
View
4 ...pse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/artifact/CreateTextAnnotationFeature.java
@@ -16,6 +16,7 @@
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
import org.eclipse.bpmn2.modeler.core.ModelHandlerLocator;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.utils.FeatureSupport;
import org.eclipse.bpmn2.modeler.ui.ImageProvider;
import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -43,7 +44,7 @@ public boolean canCreate(ICreateContext context) {
try {
ModelHandler mh = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
ta = ModelHandler.FACTORY.createTextAnnotation();
- ta.setId(EcoreUtil.generateUUID());
+// ta.setId(EcoreUtil.generateUUID());
mh.addArtifact(FeatureSupport.getTargetParticipant(context, mh), ta);
ta.setText("Enter your comment here");
} catch (IOException e) {
@@ -51,6 +52,7 @@ public boolean canCreate(ICreateContext context) {
}
addGraphicalRepresentation(context, ta);
+ DIImport.setID(ta);
return new Object[] { ta };
}
View
4 org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/artifact/GroupFeatureContainer.java
@@ -13,6 +13,7 @@
import org.eclipse.bpmn2.Artifact;
import org.eclipse.bpmn2.Group;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.features.AbstractBpmnAddFeature;
import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
import org.eclipse.bpmn2.modeler.core.features.DefaultBPMNResizeFeature;
@@ -129,7 +130,8 @@ public boolean canCreate(ICreateContext context) {
@Override
public Artifact createArtifact(ICreateContext context) {
Group group = ModelHandler.FACTORY.createGroup();
- group.setId(EcoreUtil.generateUUID());
+// group.setId(EcoreUtil.generateUUID());
+ DIImport.setID(group);
return group;
}
View
4 ...e.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/conversation/CreateConversationFeature.java
@@ -15,6 +15,7 @@
import org.eclipse.bpmn2.Conversation;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.ui.ImageProvider;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -38,9 +39,10 @@ public boolean canCreate(ICreateContext context) {
try {
ModelHandler handler = ModelHandler.getInstance(getDiagram());
c = ModelHandler.FACTORY.createConversation();
- c.setId(EcoreUtil.generateUUID());
+// c.setId(EcoreUtil.generateUUID());
c.setName("Conversation");
handler.addConversationNode(c);
+ DIImport.setID(c);
} catch (IOException e) {
Activator.logError(e);
}
View
4 org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataInputFeatureContainer.java
@@ -12,6 +12,7 @@
import org.eclipse.bpmn2.DataInput;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.features.data.AbstractCreateDataInputOutputFeature;
import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
@@ -67,9 +68,10 @@ public CreateDataInputFeature(IFeatureProvider fp) {
@Override
public DataInput add(Object target, ModelHandler handler) {
DataInput dataInput = ModelHandler.FACTORY.createDataInput();
- dataInput.setId(EcoreUtil.generateUUID());
+// dataInput.setId(EcoreUtil.generateUUID());
dataInput.setName("Data Input");
handler.addDataInput(target, dataInput);
+ DIImport.setID(dataInput);
return dataInput;
}
View
4 org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataOutputFeatureContainer.java
@@ -12,6 +12,7 @@
import org.eclipse.bpmn2.DataOutput;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.features.data.AbstractCreateDataInputOutputFeature;
import org.eclipse.bpmn2.modeler.core.features.data.AddDataFeature;
import org.eclipse.bpmn2.modeler.core.utils.GraphicsUtil;
@@ -68,9 +69,10 @@ public CreateDataOutputFeature(IFeatureProvider fp) {
@Override
public DataOutput add(Object target, ModelHandler handler) {
DataOutput dataOutput = ModelHandler.FACTORY.createDataOutput();
- dataOutput.setId(EcoreUtil.generateUUID());
+// dataOutput.setId(EcoreUtil.generateUUID());
dataOutput.setName("Data Output");
handler.addDataOutput(target, dataOutput);
+ DIImport.setID(dataOutput);
return dataOutput;
}
View
4 ....bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/data/DataStoreReferenceFeatureContainer.java
@@ -15,6 +15,7 @@
import org.eclipse.bpmn2.DataStore;
import org.eclipse.bpmn2.DataStoreReference;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.features.AbstractBpmnAddFeature;
import org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature;
import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
@@ -177,8 +178,9 @@ protected DataStoreReference createFlowElement(ICreateContext context) {
dataStoreReference.setName("Data Store Ref");
DataStore dataStore = ModelHandler.FACTORY.createDataStore();
dataStore.setName("Data Store");
- dataStore.setId(EcoreUtil.generateUUID());
+// dataStore.setId(EcoreUtil.generateUUID());
ModelHandler.getInstance(getDiagram()).addRootElement(dataStore);
+ DIImport.setID(dataStore);
} catch (IOException e) {
Activator.showErrorWithLogging(e);
}
View
4 ...eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/BoundaryEventCreateFeature.java
@@ -17,6 +17,7 @@
import org.eclipse.bpmn2.FlowElementsContainer;
import org.eclipse.bpmn2.modeler.core.Activator;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.ui.ImageProvider;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.graphiti.features.IFeatureProvider;
@@ -49,7 +50,7 @@ public boolean canCreate(ICreateContext context) {
Activity activity = (Activity) getBusinessObjectForPictogramElement(context.getTargetContainer());
ModelHandler handler = ModelHandler.getInstance(getDiagram());
event = ModelHandler.FACTORY.createBoundaryEvent();
- event.setId(EcoreUtil.generateUUID());
+// event.setId(EcoreUtil.generateUUID());
event.setAttachedToRef(activity);
event.setName("Boundary event");
event.setCancelActivity(true); // by default is interrupting
@@ -62,6 +63,7 @@ public boolean canCreate(ICreateContext context) {
Activator.logError(e);
}
addGraphicalRepresentation(context, event);
+ DIImport.setID(event);
return new Object[] { event };
}
View
4 ...deler.ui/src/org/eclipse/bpmn2/modeler/ui/features/event/definitions/CancelEventDefinitionContainer.java
@@ -17,6 +17,7 @@
import org.eclipse.bpmn2.EventDefinition;
import org.eclipse.bpmn2.IntermediateThrowEvent;
import org.eclipse.bpmn2.modeler.core.ModelHandler;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.core.features.event.definitions.CreateEventDefinition;
import org.eclipse.bpmn2.modeler.core.features.event.definitions.DecorationAlgorithm;
import org.eclipse.bpmn2.modeler.core.features.event.definitions.EventDefinitionFeatureContainer;
@@ -115,7 +116,8 @@ public boolean canCreate(ICreateContext context) {
@Override
protected EventDefinition createEventDefinition(ICreateContext context) {
CancelEventDefinition definition = ModelHandler.FACTORY.createCancelEventDefinition();
- definition.setId(EcoreUtil.generateUUID());
+// definition.setId(EcoreUtil.generateUUID());
+ DIImport.setID(definition);
return definition;
}
View
4 ...ipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/ImprovedAdvancedPropertiesComposite.java
@@ -15,6 +15,7 @@
import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.modeler.core.Bpmn2Preferences;
+import org.eclipse.bpmn2.modeler.core.di.DIImport;
import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
import org.eclipse.bpmn2.provider.Bpmn2ItemProviderAdapterFactory;
import org.eclipse.emf.common.notify.Notification;
@@ -261,7 +262,8 @@ private void createNewProperty(final EObject baseElement, final EReference eRefe
if (value instanceof BaseElement) {
BaseElement e = ((BaseElement) value);
if (e.getId() == null) {
- e.setId(EcoreUtil.generateUUID());
+// e.setId(EcoreUtil.generateUUID());
+ DIImport.setID(e,baseElement.eResource());
}
}

No commit comments for this range

Something went wrong with that request. Please try again.