HEMERA-2124: Implemented DataInputAssociation and DataOutputAssociation
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandler.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandler.java index 1d92979..d94f2b3 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandler.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/ModelHandler.java
@@ -16,18 +16,23 @@ import java.util.ArrayList; import java.util.List; +import org.eclipse.bpmn2.Activity; import org.eclipse.bpmn2.Artifact; import org.eclipse.bpmn2.Association; import org.eclipse.bpmn2.BaseElement; import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CatchEvent; import org.eclipse.bpmn2.Choreography; import org.eclipse.bpmn2.ChoreographyTask; import org.eclipse.bpmn2.Collaboration; import org.eclipse.bpmn2.ConditionalEventDefinition; import org.eclipse.bpmn2.ConversationLink; import org.eclipse.bpmn2.ConversationNode; +import org.eclipse.bpmn2.DataAssociation; import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataInputAssociation; import org.eclipse.bpmn2.DataOutput; +import org.eclipse.bpmn2.DataOutputAssociation; import org.eclipse.bpmn2.Definitions; import org.eclipse.bpmn2.DocumentRoot; import org.eclipse.bpmn2.EndEvent; @@ -47,6 +52,7 @@ import org.eclipse.bpmn2.SequenceFlow; import org.eclipse.bpmn2.StartEvent; import org.eclipse.bpmn2.SubProcess; +import org.eclipse.bpmn2.ThrowEvent; import org.eclipse.bpmn2.di.BPMNDiagram; import org.eclipse.bpmn2.di.BPMNEdge; import org.eclipse.bpmn2.di.BPMNPlane; @@ -646,6 +652,32 @@ association.setTargetRef(target); return association; } + + public DataAssociation createDataAssociation(BaseElement source, BaseElement target) { + DataAssociation dataAssocation = null; + if (source instanceof ItemAwareElement) { + dataAssocation = create(DataInputAssociation.class); + dataAssocation.getSourceRef().add((ItemAwareElement) source); + if (target instanceof Activity) { + Activity activity = (Activity) target; + activity.getDataInputAssociations().add((DataInputAssociation) dataAssocation); + } else if (target instanceof ThrowEvent) { + ThrowEvent throwEvent = (ThrowEvent) target; + throwEvent.getDataInputAssociation().add((DataInputAssociation) dataAssocation); + } + } else if (target instanceof ItemAwareElement) { + dataAssocation = create(DataOutputAssociation.class); + dataAssocation.setTargetRef((ItemAwareElement) target); + if (source instanceof Activity) { + Activity activity = (Activity) source; + activity.getDataOutputAssociations().add((DataOutputAssociation) dataAssocation); + } else if (source instanceof CatchEvent) { + CatchEvent throwEvent = (CatchEvent) source; + throwEvent.getDataOutputAssociation().add((DataOutputAssociation) dataAssocation); + } + } + return dataAssocation; + } private Collaboration getCollaboration() { final List<RootElement> rootElements = getDefinitions().getRootElements();
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/BPMNFeatureProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/BPMNFeatureProvider.java index 6af581e..2169dfd 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/BPMNFeatureProvider.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/BPMNFeatureProvider.java
@@ -76,8 +76,7 @@ import org.eclipse.bpmn2.modeler.ui.features.event.definitions.TerminateEventDefinitionFeatureContainer; import org.eclipse.bpmn2.modeler.ui.features.event.definitions.TimerEventDefinitionContainer; import org.eclipse.bpmn2.modeler.ui.features.flow.AssociationFeatureContainer; -import org.eclipse.bpmn2.modeler.ui.features.flow.DataInputAssociationFeatureContainer; -import org.eclipse.bpmn2.modeler.ui.features.flow.DataOutputAssociationFeatureContainer; +import org.eclipse.bpmn2.modeler.ui.features.flow.DataAssociationFeatureContainer; import org.eclipse.bpmn2.modeler.ui.features.flow.MessageFlowFeatureContainer; import org.eclipse.bpmn2.modeler.ui.features.flow.SequenceFlowFeatureContainer; import org.eclipse.bpmn2.modeler.ui.features.gateway.ComplexGatewayFeatureContainer; @@ -190,8 +189,7 @@ containers.add(new AssociationFeatureContainer()); containers.add(new ConversationFeatureContainer()); containers.add(new ConversationLinkFeatureContainer()); - containers.add(new DataInputAssociationFeatureContainer()); - containers.add(new DataOutputAssociationFeatureContainer()); + containers.add(new DataAssociationFeatureContainer()); containers.add(new SubChoreographyFeatureContainer()); containers.add(new CallChoreographyFeatureContainer()); containers.add(new ParticipantFeatureContainer());
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataAssociationFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataAssociationFeatureContainer.java new file mode 100644 index 0000000..1efbd04 --- /dev/null +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataAssociationFeatureContainer.java
@@ -0,0 +1,296 @@ +package org.eclipse.bpmn2.modeler.ui.features.flow; + +import java.io.IOException; + +import org.eclipse.bpmn2.Activity; +import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.Bpmn2Package; +import org.eclipse.bpmn2.CatchEvent; +import org.eclipse.bpmn2.DataAssociation; +import org.eclipse.bpmn2.DataInputAssociation; +import org.eclipse.bpmn2.DataOutputAssociation; +import org.eclipse.bpmn2.ItemAwareElement; +import org.eclipse.bpmn2.ThrowEvent; +import org.eclipse.bpmn2.di.BPMNEdge; +import org.eclipse.bpmn2.modeler.core.ModelHandler; +import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer; +import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature; +import org.eclipse.bpmn2.modeler.core.features.flow.AbstractCreateFlowFeature; +import org.eclipse.bpmn2.modeler.core.features.flow.AbstractReconnectFlowFeature; +import org.eclipse.bpmn2.modeler.core.utils.AnchorUtil; +import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil; +import org.eclipse.bpmn2.modeler.core.utils.StyleUtil; +import org.eclipse.bpmn2.modeler.ui.ImageProvider; +import org.eclipse.dd.di.DiagramElement; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.graphiti.features.IAddFeature; +import org.eclipse.graphiti.features.ICreateConnectionFeature; +import org.eclipse.graphiti.features.IFeatureProvider; +import org.eclipse.graphiti.features.IReconnectionFeature; +import org.eclipse.graphiti.features.context.ICreateConnectionContext; +import org.eclipse.graphiti.features.context.IReconnectionContext; +import org.eclipse.graphiti.features.context.impl.ReconnectionContext; +import org.eclipse.graphiti.mm.algorithms.Polyline; +import org.eclipse.graphiti.mm.algorithms.styles.LineStyle; +import org.eclipse.graphiti.mm.pictograms.Anchor; +import org.eclipse.graphiti.mm.pictograms.AnchorContainer; +import org.eclipse.graphiti.mm.pictograms.Connection; +import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator; +import org.eclipse.graphiti.mm.pictograms.Shape; +import org.eclipse.graphiti.services.Graphiti; +import org.eclipse.graphiti.services.IGaService; +import org.eclipse.graphiti.services.IPeService; + + +public class DataAssociationFeatureContainer extends BaseElementConnectionFeatureContainer { + + @Override + public boolean canApplyTo(Object o) { + return super.canApplyTo(o) && o instanceof DataAssociation; + } + + public class AddDataAssocationFeature extends AbstractAddFlowFeature<DataAssociation> { + + public AddDataAssocationFeature(IFeatureProvider fp) { + super(fp); + } + + @Override + protected Polyline createConnectionLine(Connection connection) { + IPeService peService = Graphiti.getPeService(); + IGaService gaService = Graphiti.getGaService(); + BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection); + + Polyline connectionLine = super.createConnectionLine(connection); + connectionLine.setLineStyle(LineStyle.DOT); + + ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true); + + int w = 5; + int l = 10; + + Polyline arrowhead = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w }); + StyleUtil.applyStyle(arrowhead, be); + + return connectionLine; + } + + @Override + protected Class< ? extends BaseElement> getBoClass() { + return DataAssociation.class; + } + + } + + public class CreateDataAssociationFeature extends AbstractCreateFlowFeature<DataAssociation, BaseElement, BaseElement> { + + public CreateDataAssociationFeature(IFeatureProvider fp) { + super(fp, "Data Association", "Associate item aware elements like data objects with activities and events"); + } + + @Override + public boolean canCreate(ICreateConnectionContext context) { + BaseElement sourceBo = getSourceBo(context); + BaseElement targetBo = getTargetBo(context); + if (sourceBo instanceof ItemAwareElement) { + if (targetBo instanceof Activity || targetBo instanceof ThrowEvent) { + return true; + } + } else if (targetBo instanceof ItemAwareElement) { + if (sourceBo instanceof Activity || sourceBo instanceof CatchEvent) { + return true; + } + } + return false; + } + + @Override + protected String getStencilImageId() { + return ImageProvider.IMG_16_ASSOCIATION; + } + + @Override + protected Class<BaseElement> getSourceClass() { + return BaseElement.class; + } + + @Override + protected Class<BaseElement> getTargetClass() { + return BaseElement.class; + } + + @Override + protected BaseElement getSourceBo(ICreateConnectionContext context) { + Anchor anchor = context.getSourceAnchor(); + if (anchor != null && anchor.getParent() instanceof Shape) { + Shape shape = (Shape) anchor.getParent(); + Connection conn = AnchorUtil.getConnectionPointOwner(shape); + if (conn!=null) { + return BusinessObjectUtil.getFirstElementOfType(conn, getTargetClass()); + } + return BusinessObjectUtil.getFirstElementOfType(shape, getTargetClass()); + } + return null; + } + + @Override + protected BaseElement getTargetBo(ICreateConnectionContext context) { + Anchor anchor = context.getTargetAnchor(); + if (anchor != null && anchor.getParent() instanceof Shape) { + Shape shape = (Shape) anchor.getParent(); + Connection conn = AnchorUtil.getConnectionPointOwner(shape); + if (conn!=null) { + return BusinessObjectUtil.getFirstElementOfType(conn, getTargetClass()); + } + return BusinessObjectUtil.getFirstElementOfType(shape, getTargetClass()); + } + return null; + } + + @Override + public DataAssociation createBusinessObject(ICreateConnectionContext context) { + DataAssociation bo = null; + try { + ModelHandler mh = ModelHandler.getInstance(getDiagram()); + BaseElement source = getSourceBo(context); + BaseElement target = getTargetBo(context); + bo = mh.createDataAssociation(source, target); + putBusinessObject(context, bo); + + } catch (IOException e) { + } + return bo; + } + + @Override + public String getCreateName() { + return "Data Association"; + } + + @Override + public EClass getBusinessObjectClass() { + return Bpmn2Package.eINSTANCE.getDataAssociation(); + } + } + + public static class ReconnectDataAssociationFeature extends AbstractReconnectFlowFeature { + + public ReconnectDataAssociationFeature(IFeatureProvider fp) { + super(fp); + } + + @Override + public boolean canReconnect(IReconnectionContext context) { + DataAssociation dataAssociation = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), DataAssociation.class); + BaseElement targetElement = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class); + if (dataAssociation instanceof DataInputAssociation) { + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_SOURCE)) { + if (targetElement instanceof ItemAwareElement) { + return true; + } + } + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) { + if (targetElement instanceof Activity || targetElement instanceof ThrowEvent) { + return true; + } + } + return false; + } + if (dataAssociation instanceof DataOutputAssociation) { + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_SOURCE)) { + if (targetElement instanceof Activity || targetElement instanceof CatchEvent) { + return true; + } + } + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) { + if (targetElement instanceof ItemAwareElement) { + return true; + } + } + } + return false; + } + + @Override + protected Class<? extends EObject> getTargetClass() { + return BaseElement.class; + } + + @Override + protected Class<? extends EObject> getSourceClass() { + return BaseElement.class; + } + + @Override + public void postReconnect(IReconnectionContext context) { + Anchor oldAnchor = context.getOldAnchor(); + AnchorContainer oldAnchorContainer = oldAnchor.getParent(); + AnchorUtil.deleteConnectionPointIfPossible(getFeatureProvider(), (Shape) oldAnchorContainer); + + BPMNEdge edge = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), BPMNEdge.class); + DiagramElement de = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), DiagramElement.class); + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) { + edge.setTargetElement(de); + } + else { + edge.setSourceElement(de); + } + + DataAssociation dataAssociation = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), DataAssociation.class); + BaseElement targetElement = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class); + if (dataAssociation instanceof DataInputAssociation) { + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_SOURCE)) { + if (targetElement instanceof ItemAwareElement) { + dataAssociation.getSourceRef().clear(); + dataAssociation.getSourceRef().add((ItemAwareElement) targetElement); + } + return; + } + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) { + if (targetElement instanceof Activity) { + Activity activity = (Activity) targetElement; + activity.getDataInputAssociations().add((DataInputAssociation) dataAssociation); + } else if (targetElement instanceof ThrowEvent) { + ThrowEvent throwEvent = (ThrowEvent) targetElement; + throwEvent.getDataInputAssociation().add((DataInputAssociation) dataAssociation); + } + return; + } + } + if (dataAssociation instanceof DataOutputAssociation) { + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_SOURCE)) { + if (targetElement instanceof Activity) { + Activity activity = (Activity) targetElement; + activity.getDataOutputAssociations().add((DataOutputAssociation) dataAssociation); + } else if (targetElement instanceof CatchEvent) { + CatchEvent throwEvent = (CatchEvent) targetElement; + throwEvent.getDataOutputAssociation().add((DataOutputAssociation) dataAssociation); + } + return; + } + if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) { + if (targetElement instanceof ItemAwareElement) { + dataAssociation.setTargetRef((ItemAwareElement) targetElement); + } + } + } + } + } + + @Override + public IAddFeature getAddFeature(IFeatureProvider fp) { + return new AddDataAssocationFeature(fp); + } + + @Override + public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) { + return new CreateDataAssociationFeature(fp); + } + + @Override + public IReconnectionFeature getReconnectionFeature(IFeatureProvider fp) { + return new ReconnectDataAssociationFeature(fp); + } + +}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataInputAssociationFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataInputAssociationFeatureContainer.java deleted file mode 100644 index 38a2d28..0000000 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataInputAssociationFeatureContainer.java +++ /dev/null
@@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Red Hat, Inc. - * All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - * - * @author Innar Made - ******************************************************************************/ -package org.eclipse.bpmn2.modeler.ui.features.flow; - -import java.io.IOException; - -import org.eclipse.bpmn2.Association; -import org.eclipse.bpmn2.BaseElement; -import org.eclipse.bpmn2.Bpmn2Package; -import org.eclipse.bpmn2.DataInputAssociation; -import org.eclipse.bpmn2.ItemAwareElement; -import org.eclipse.bpmn2.modeler.core.ModelHandler; -import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature; -import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil; -import org.eclipse.bpmn2.modeler.core.utils.StyleUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.graphiti.features.IAddFeature; -import org.eclipse.graphiti.features.ICreateConnectionFeature; -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.features.context.ICreateConnectionContext; -import org.eclipse.graphiti.mm.algorithms.Polyline; -import org.eclipse.graphiti.mm.algorithms.styles.LineStyle; -import org.eclipse.graphiti.mm.pictograms.Connection; -import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IGaService; -import org.eclipse.graphiti.services.IPeService; - -public class DataInputAssociationFeatureContainer extends AssociationFeatureContainer { - - @Override - public boolean canApplyTo(Object o) { - return super.canApplyTo(o) && o instanceof DataInputAssociation; - } - - @Override - public IAddFeature getAddFeature(IFeatureProvider fp) { - return new AbstractAddFlowFeature<DataInputAssociation>(fp) { - - @Override - protected Polyline createConnectionLine(Connection connection) { - IPeService peService = Graphiti.getPeService(); - IGaService gaService = Graphiti.getGaService(); - BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection); - - Polyline connectionLine = super.createConnectionLine(connection); - connectionLine.setLineStyle(LineStyle.DOT); - - ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true); - - int w = 5; - int l = 10; - - Polyline arrowhead = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w }); - StyleUtil.applyStyle(arrowhead, be); - - return connectionLine; - } - - @Override - protected Class<? extends BaseElement> getBoClass() { - return DataInputAssociation.class; - } - }; - } - - @Override - public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) { - return new CreateAssociationFeature(fp) { - @Override - public Association createBusinessObject(ICreateConnectionContext context) { - Association bo = null; - try { - ModelHandler mh = ModelHandler.getInstance(getDiagram()); - BaseElement source = getSourceBo(context); - BaseElement target = getTargetBo(context); - bo = mh.createAssociation(source, target); - putBusinessObject(context, bo); - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return bo; - } - - @Override - public boolean canCreate(ICreateConnectionContext context) { - BaseElement sourceBo = getSourceBo(context); - BaseElement targetBo = getTargetBo(context); - - return sourceBo instanceof ItemAwareElement || targetBo instanceof ItemAwareElement; - } - - - - @Override - public String getCreateName() { - return "Data Association"; - } - - @Override - public EClass getBusinessObjectClass() { - return Bpmn2Package.eINSTANCE.getDataAssociation(); - } - }; - } - -} \ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataOutputAssociationFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataOutputAssociationFeatureContainer.java deleted file mode 100644 index 56a5272..0000000 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/DataOutputAssociationFeatureContainer.java +++ /dev/null
@@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Red Hat, Inc. - * All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - * - * @author Innar Made - ******************************************************************************/ -package org.eclipse.bpmn2.modeler.ui.features.flow; - -import org.eclipse.bpmn2.BaseElement; -import org.eclipse.bpmn2.DataOutputAssociation; -import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer; -import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature; -import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil; -import org.eclipse.bpmn2.modeler.core.utils.StyleUtil; -import org.eclipse.graphiti.features.IAddFeature; -import org.eclipse.graphiti.features.ICreateConnectionFeature; -import org.eclipse.graphiti.features.IFeatureProvider; -import org.eclipse.graphiti.mm.algorithms.Polyline; -import org.eclipse.graphiti.mm.algorithms.styles.LineStyle; -import org.eclipse.graphiti.mm.pictograms.Connection; -import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator; -import org.eclipse.graphiti.services.Graphiti; -import org.eclipse.graphiti.services.IGaService; -import org.eclipse.graphiti.services.IPeService; - -public class DataOutputAssociationFeatureContainer extends BaseElementConnectionFeatureContainer { - - @Override - public boolean canApplyTo(Object o) { - return super.canApplyTo(o) && o instanceof DataOutputAssociation; - } - - @Override - public IAddFeature getAddFeature(IFeatureProvider fp) { - return new AbstractAddFlowFeature<DataOutputAssociation>(fp) { - - @Override - protected Polyline createConnectionLine(Connection connection) { - IPeService peService = Graphiti.getPeService(); - IGaService gaService = Graphiti.getGaService(); - BaseElement be = BusinessObjectUtil.getFirstBaseElement(connection); - - Polyline connectionLine = super.createConnectionLine(connection); - connectionLine.setLineStyle(LineStyle.DOT); - - ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true); - - int w = 5; - int l = 10; - - Polyline arrowhead = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w }); - StyleUtil.applyStyle(arrowhead, be); - - return connectionLine; - } - - @Override - protected Class<? extends BaseElement> getBoClass() { - return DataOutputAssociation.class; - } - }; - } - - @Override - public ICreateConnectionFeature getCreateConnectionFeature(IFeatureProvider fp) { - return null; - } -} \ No newline at end of file
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/MessageFlowFeatureContainer.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/MessageFlowFeatureContainer.java index 13dcc6a..5003f63 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/MessageFlowFeatureContainer.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/flow/MessageFlowFeatureContainer.java
@@ -22,7 +22,6 @@ import org.eclipse.bpmn2.modeler.core.Activator; import org.eclipse.bpmn2.modeler.core.ModelHandler; import org.eclipse.bpmn2.modeler.core.features.BaseElementConnectionFeatureContainer; -import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature; import org.eclipse.bpmn2.modeler.core.features.UpdateBaseElementNameFeature; import org.eclipse.bpmn2.modeler.core.features.flow.AbstractAddFlowFeature; import org.eclipse.bpmn2.modeler.core.features.flow.AbstractCreateFlowFeature; @@ -39,8 +38,6 @@ import org.eclipse.graphiti.features.IReconnectionFeature; import org.eclipse.graphiti.features.IUpdateFeature; import org.eclipse.graphiti.features.context.ICreateConnectionContext; -import org.eclipse.graphiti.features.context.ICreateContext; -import org.eclipse.graphiti.features.context.impl.AddConnectionContext; import org.eclipse.graphiti.mm.algorithms.Ellipse; import org.eclipse.graphiti.mm.algorithms.Polyline; import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;