Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2019-05-23 03:35:06 -0400
committerPatrick Tessier2019-05-23 05:59:57 -0400
commit889f4d8cafc5b2a0225e9fa38be07157daca1e7e (patch)
tree67852b8e975bcef01c4dbbebf782744262dbb02a /plugins
parent4b2cf01b47527be213eedd1f024aba6557873001 (diff)
downloadorg.eclipse.papyrus-889f4d8cafc5b2a0225e9fa38be07157daca1e7e.tar.gz
org.eclipse.papyrus-889f4d8cafc5b2a0225e9fa38be07157daca1e7e.tar.xz
org.eclipse.papyrus-889f4d8cafc5b2a0225e9fa38be07157daca1e7e.zip
Bug 542802: [SequenceDiagram] Undo after message creation removes other
elements from the model - Manage the undo manually because an action was done silently after the command execution that's re-order the items in interaction or interaction operand, so the undo delete the wrong elements. Change-Id: I3507d7ffe744ce19876aa6132312cb181dae3c5b Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java139
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java25
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java388
5 files changed, 439 insertions, 117 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
index 4d0afa36566..e08ff9493ce 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
@@ -70,7 +70,7 @@ Require-Bundle: org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3
org.eclipse.papyrus.uml.service.validation;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.infra.services.validation;bundle-version="[3.0.0,4.0.0)"
Bundle-Vendor: %providerName
-Bundle-Version: 5.1.100.qualifier
+Bundle-Version: 5.2.0.qualifier
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin
Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.sequence; singleton:=true
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java
index cff9fe915d7..8b14d785590 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2017 CEA LIST and others.
+ * Copyright (c) 2017, 2019 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 542802
*
*****************************************************************************/
@@ -24,9 +25,12 @@ import java.util.stream.StreamSupport;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.EditPart;
@@ -44,7 +48,9 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand;
@@ -56,17 +62,19 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.messages.Messages;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.diagram.sequence.preferences.CustomDiagramGeneralPreferencePage;
+import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceDeleteHelper;
import org.eclipse.papyrus.uml.service.types.element.UMLDIElementTypes;
+import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
import org.eclipse.uml2.uml.ExecutionSpecification;
+import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.InteractionOperand;
import org.eclipse.uml2.uml.Message;
import org.eclipse.uml2.uml.MessageEnd;
import org.eclipse.uml2.uml.OccurrenceSpecification;
import org.eclipse.uml2.uml.UMLPackage;
/**
- * this class is used to automatically create execution specifications at target
- * from the request in charge of creating a message between lifelines
- * according to the preferences for this message sort
+ * This class is used to automatically create execution specifications at target from the request in charge of creating a message between lifelines according to the preferences for this message sort.
*/
public class CreateExecutionSpecificationWithMessage extends AbstractTransactionalCommand {
@@ -78,6 +86,16 @@ public class CreateExecutionSpecificationWithMessage extends AbstractTransaction
protected boolean createReply;
/**
+ * This allows to stove the created execution specification needed for the undo.
+ */
+ private ExecutionSpecification createdExecutionSpecification;
+
+ /**
+ * This allows to store the created message reply needed for the undo.
+ */
+ private Message createdMessageReply;
+
+ /**
* @param domain
* @param request
* the request that is in charge of creating the message
@@ -93,15 +111,12 @@ public class CreateExecutionSpecificationWithMessage extends AbstractTransaction
}
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ * {@inheritDoc}
*
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
*/
@Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
// 1. look for the message triggering the creation of the execution specification
Message message = getMessage();
if (message == null) {
@@ -118,6 +133,93 @@ public class CreateExecutionSpecificationWithMessage extends AbstractTransaction
return CommandResult.newOKCommandResult();
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doUndo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected IStatus doUndo(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+
+ // Remove the reply message
+ if (null != createdMessageReply) {
+ // First delete the send and receive events
+ final MessageEnd sendEvent = createdMessageReply.getSendEvent();
+ final MessageEnd receiveEvent = createdMessageReply.getReceiveEvent();
+
+ final CompoundCommand compoundCommand = new CompoundCommand();
+ SequenceDeleteHelper.destroyMessageEvent(compoundCommand, sendEvent, getEditingDomain());
+ if (false == receiveEvent instanceof DestructionOccurrenceSpecification) {
+ SequenceDeleteHelper.destroyMessageEvent(compoundCommand, receiveEvent, getEditingDomain());
+ }
+ if (!compoundCommand.isEmpty() && compoundCommand.canExecute()) {
+ compoundCommand.execute();
+ }
+
+ // Destroy the graphical representation first
+ final CompositeTransactionalCommand compositeCommand = new CompositeTransactionalCommand(getEditingDomain(), "Remove message view"); //$NON-NLS-1$
+ SequenceDeleteHelper.deleteView(compositeCommand, createdMessageReply, getEditingDomain());
+ compositeCommand.execute(monitor, info);
+
+ // Remove the reply message
+ final EObject container = createdMessageReply.eContainer();
+ if (container instanceof Interaction) {
+ ((Interaction) container).getMessages().remove(createdMessageReply);
+ }
+ }
+ // Remove the execution specification
+ if (null != createdExecutionSpecification) {
+ // First delete its start and finish
+ final OccurrenceSpecification start = createdExecutionSpecification.getStart();
+ final OccurrenceSpecification finish = createdExecutionSpecification.getFinish();
+ final CompoundCommand compoundCommand = new CompoundCommand();
+
+ if (null != start) {
+ DestroyElementRequest delStart = new DestroyElementRequest(getEditingDomain(), start, false);
+ compoundCommand.add(new ICommandProxy(new DestroyElementCommand(delStart)));
+ }
+ if (null != finish) {
+ DestroyElementRequest delEnd = new DestroyElementRequest(getEditingDomain(), finish, false);
+ compoundCommand.add(new ICommandProxy(new DestroyElementCommand(delEnd)));
+ }
+ if (!compoundCommand.isEmpty() && compoundCommand.canExecute()) {
+ compoundCommand.execute();
+ }
+
+ // Destroy the graphical representation first
+ final CompositeTransactionalCommand compositeCommand = new CompositeTransactionalCommand(getEditingDomain(), "Remove execution specification view"); //$NON-NLS-1$
+ SequenceDeleteHelper.deleteView(compositeCommand, createdExecutionSpecification, getEditingDomain());
+ compositeCommand.execute(monitor, info);
+ // Remove the execution specification
+ final EObject container = createdExecutionSpecification.eContainer();
+ if (container instanceof Interaction) {
+ ((Interaction) container).getFragments().remove(createdExecutionSpecification);
+ } else if (container instanceof InteractionOperand) {
+ ((InteractionOperand) container).getFragments().remove(createdExecutionSpecification);
+ }
+ }
+
+ // Clear the stored values because the redo will fill this fields if needed
+ createdExecutionSpecification = null;
+ createdMessageReply = null;
+
+ setResult(new CommandResult(Status.OK_STATUS));
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doRedo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected IStatus doRedo(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ // Only re-execute the initial process
+ final CommandResult result = doExecuteWithResult(monitor, info);
+
+ setResult(result);
+ return result.getStatus();
+ }
/**
@@ -131,16 +233,17 @@ public class CreateExecutionSpecificationWithMessage extends AbstractTransaction
requestcreation.setLocation(point);
Command command = lifelineEditPart.getCommand(requestcreation);
command.execute();
+ // Save the created execution specification for the possible undo
+ createdExecutionSpecification = getCreatedElement(command, ExecutionSpecification.class);
// case where a reply message must also be created
if (createReply) {
// Gets the created execution specification
- ExecutionSpecification executionSpecification = getCreatedElement(command, ExecutionSpecification.class);
- if (null != executionSpecification) {
+ if (null != createdExecutionSpecification) {
Point replysourcepoint = point.getCopy();
replysourcepoint.setY(replysourcepoint.y + CustomActionExecutionSpecificationEditPart.DEFAULT_HEIGHT);
// source of the reply message is the end of the execution specification
- createReplyMessage(lifelineEditPart, executionSpecification, replysourcepoint);
+ createReplyMessage(lifelineEditPart, createdExecutionSpecification, replysourcepoint);
}
}
}
@@ -178,9 +281,10 @@ public class CreateExecutionSpecificationWithMessage extends AbstractTransaction
replycommand.execute();
// replace execution Specification finish event by the message reply send event.
- Message messageReply = getCreatedElement(replycommand, Message.class);
- if (null != messageReply) {
- MessageEnd sendEvent = messageReply.getSendEvent();
+ // Save the created execution specification for the possible undo
+ createdMessageReply = getCreatedElement(replycommand, Message.class);
+ if (null != createdMessageReply) {
+ MessageEnd sendEvent = createdMessageReply.getSendEvent();
OccurrenceSpecification finish = executionSpecification.getFinish();
SetCommand setSendEventCommand = new SetCommand(getEditingDomain(), executionSpecification, UMLPackage.eINSTANCE.getExecutionSpecification_Finish(), sendEvent);
setSendEventCommand.execute();
@@ -188,7 +292,8 @@ public class CreateExecutionSpecificationWithMessage extends AbstractTransaction
// delete the old finish os.
DestroyElementPapyrusCommand destroyElementPapyrusCommand = new DestroyElementPapyrusCommand(new DestroyElementRequest(finish, false));
if (destroyElementPapyrusCommand != null && destroyElementPapyrusCommand.canExecute()) {
- getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyElementPapyrusCommand));
+ new GMFtoEMFCommandWrapper(destroyElementPapyrusCommand).execute();
+ // getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyElementPapyrusCommand));
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
index 541196959fe..9274494882b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
+ * Copyright (c) 2010, 2019 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +10,7 @@
*
* Contributors:
* Atos Origin - Initial API and implementation
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 542802
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.util;
@@ -125,7 +125,7 @@ public class SequenceDeleteHelper {
if (lifelineChild instanceof IBorderItemEditPart) {
final IBorderItemEditPart timePart = (IBorderItemEditPart) lifelineChild;
OccurrenceSpecification start = execution.getStart();
- OccurrenceSpecification finish = execution.getStart();
+ OccurrenceSpecification finish = execution.getFinish();
int positionForStart = SequenceUtil.positionWhereEventIsLinkedToPart(start, timePart);
int positionForFinish = SequenceUtil.positionWhereEventIsLinkedToPart(finish, timePart);
if (positionForStart != PositionConstants.NONE || positionForFinish != PositionConstants.NONE) {
@@ -234,13 +234,24 @@ public class SequenceDeleteHelper {
}
}
- static void destroyMessageEvent(CompoundCommand deleteElementsCommand, MessageEnd event, TransactionalEditingDomain transactionalEditingDomain) {
+ /**
+ * This allows to destroy a message event.
+ *
+ * @param deleteElementsCommand
+ * The compound command to fill.
+ * @param event
+ * The event to delete.
+ * @param transactionalEditingDomain
+ * The editing domain.
+ * @since 5.2
+ */
+ public static void destroyMessageEvent(final CompoundCommand deleteElementsCommand, final MessageEnd event, final TransactionalEditingDomain transactionalEditingDomain) {
if (event != null) {
- DestroyElementRequest myReq = new DestroyElementRequest(transactionalEditingDomain, event, false);
+ final DestroyElementRequest myReq = new DestroyElementRequest(transactionalEditingDomain, event, false);
// Sometimes, the message end is also the end of a execution.
- RestoreExecutionEndAdvice provider = new RestoreExecutionEndAdvice();
+ final RestoreExecutionEndAdvice provider = new RestoreExecutionEndAdvice();
if (provider != null) {
- ICommand editCommand = provider.getAfterEditCommand(myReq);
+ final ICommand editCommand = provider.getAfterEditCommand(myReq);
if (editCommand != null && editCommand.canExecute()) {
deleteElementsCommand.add(new ICommandProxy(editCommand));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
index 4fb62e318aa..37b2326dc68 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
@@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.diagram.sequence</artifactId>
- <version>5.1.100-SNAPSHOT</version>
+ <version>5.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java
index 16e762f77e4..cff1416e517 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2017 CEA LIST and others.
- *
+ * Copyright (c) 2017, 2019 CEA LIST and others.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,15 +10,26 @@
*
* Contributors:
* Celine JANSSENS (ALL4TEC) - Initial API and implementation
- *
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 542802
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.command;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -37,6 +48,7 @@ import org.eclipse.uml2.uml.ExecutionOccurrenceSpecification;
import org.eclipse.uml2.uml.ExecutionSpecification;
import org.eclipse.uml2.uml.Gate;
import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.InteractionOperand;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.Message;
import org.eclipse.uml2.uml.MessageEnd;
@@ -46,54 +58,85 @@ import org.eclipse.uml2.uml.OccurrenceSpecification;
import org.eclipse.uml2.uml.UMLFactory;
/**
- * @author CĂ©line JANSSENS
- * @since 3.1
+ * This allows to configure the creation of message event.
*
+ * @since 3.1
*/
public class ConfigureMessageEventCommand extends ConfigureElementCommand {
+ /**
+ * The created message ends (needed for the undo).
+ */
+ private List<MessageOccurrenceSpecification> createdMessageEnds;
+
+ /**
+ * The created messages ends covering lifelines (needed for the undo).
+ */
+ private Map<Lifeline, List<MessageOccurrenceSpecification>> coveredLifelines;
+
+ /**
+ * The initial message before its modification (needed for the undo).
+ */
+ private Message oldMessage;
+
+ /**
+ * The possible element to replace by the message sent (needed for the undo).
+ */
+ private ExecutionOccurrenceSpecification oldToReplacebyMessageSent;
+
+ /**
+ * The possible element to replace by the message receive (needed for the undo).
+ */
+ private ExecutionOccurrenceSpecification oldToReplacebyMessageReceive;
+
+ /**
+ * The list of element destroyed by commands (needed for the undo).
+ */
+ private List<ICommand> destroyedElementsCommands;
+
+ /**
+ * The initial request.
+ */
private ConfigureRequest request;
+
/**
* Constructor.
*
+ * @param request
+ * The initial request.
*/
- public ConfigureMessageEventCommand(ConfigureRequest request) {
+ public ConfigureMessageEventCommand(final ConfigureRequest request) {
super(request);
this.request = request;
}
/**
- * This method provides the source type provided as {@link ConfigureRequest} parameter.
- *
- * @return the target role
- * @since 3.0
- */
- protected Element getSource(ConfigureRequest req) {
- Element result = null;
- Object paramObject = req.getParameter(CreateRelationshipRequest.SOURCE);
- if (paramObject instanceof Element) {
- result = (Element) paramObject;
- }
-
- return result;
- }
-
- /**
* Create a MessageEnd
*
* @param message
- * the message that reference the message end always !=null
+ * The message that reference the message end always !=null.
* @param lifeline
- * the lifeLine where is set the message end ,always !=null
+ * The lifeLine where is set the message end always !=null.
+ * @param previous
+ * The element to detect where add the covering of lifeline.
* @since 3.0
*/
- public static MessageEnd createMessageEnd(Message message, Lifeline lifeline, final MessageEnd previous) {
- MessageOccurrenceSpecification messageOccurrenceSpecification = UMLFactory.eINSTANCE.createMessageOccurrenceSpecification();
+ public MessageOccurrenceSpecification createMessageEnd(Message message, Lifeline lifeline, final MessageEnd previous) {
+ final MessageOccurrenceSpecification messageOccurrenceSpecification = UMLFactory.eINSTANCE.createMessageOccurrenceSpecification();
if (previous == null) {
messageOccurrenceSpecification.setCovered(lifeline);
} else {
- lifeline.getCoveredBys().add(lifeline.getCoveredBys().indexOf(previous) + 1, messageOccurrenceSpecification);
+ final int index = lifeline.getCoveredBys().indexOf(previous) + 1;
+ lifeline.getCoveredBys().add(index, messageOccurrenceSpecification);
+ // Store the added covered to manage the undo if needed
+ if (coveredLifelines == null) {
+ coveredLifelines = new HashMap<>();
+ }
+ if (!coveredLifelines.containsKey(lifeline)) {
+ coveredLifelines.put(lifeline, new ArrayList<MessageOccurrenceSpecification>());
+ }
+ coveredLifelines.get(lifeline).add(messageOccurrenceSpecification);
}
messageOccurrenceSpecification.setMessage(message);
((Interaction) message.getOwner()).getFragments().add(messageOccurrenceSpecification);
@@ -104,13 +147,13 @@ public class ConfigureMessageEventCommand extends ConfigureElementCommand {
* Create a MessageEnd
*
* @param message
- * the message that reference the message end always !=null
+ * The message that reference the message end always !=null.
* @param lifeline
- * the lifeLine where is set the message end ,always !=null
+ * The lifeLine where is set the message end ,always !=null.
* @since 3.0
*/
- public static MessageEnd createDestroyMessageEnd(Message message, Lifeline lifeline) {
- DestructionOccurrenceSpecification messageOccurrenceSpecification = UMLFactory.eINSTANCE.createDestructionOccurrenceSpecification();
+ public DestructionOccurrenceSpecification createDestroyMessageEnd(final Message message, final Lifeline lifeline) {
+ final DestructionOccurrenceSpecification messageOccurrenceSpecification = UMLFactory.eINSTANCE.createDestructionOccurrenceSpecification();
messageOccurrenceSpecification.setCovered(lifeline);
messageOccurrenceSpecification.setMessage(message);
((Interaction) message.getOwner()).getFragments().add(messageOccurrenceSpecification);
@@ -118,14 +161,16 @@ public class ConfigureMessageEventCommand extends ConfigureElementCommand {
}
/**
- * This method provides the target type provided as {@link ConfigureRequest} parameter.
- *
- * @return the target role
+ * This method provides the source type provided as {@link ConfigureRequest} parameter.
+ *
+ * @param req
+ * The configure request.
+ * @return The target role.
* @since 3.0
*/
- protected Element getTarget(ConfigureRequest req) {
+ protected Element getSource(final ConfigureRequest req) {
Element result = null;
- Object paramObject = req.getParameter(CreateRelationshipRequest.TARGET);
+ final Object paramObject = req.getParameter(CreateRelationshipRequest.SOURCE);
if (paramObject instanceof Element) {
result = (Element) paramObject;
}
@@ -133,72 +178,102 @@ public class ConfigureMessageEventCommand extends ConfigureElementCommand {
return result;
}
+ /**
+ * This method provides the target type provided as {@link ConfigureRequest} parameter.
+ *
+ * @param req
+ * The configure request.
+ * @return The target role.
+ * @since 3.0
+ */
+ protected Element getTarget(final ConfigureRequest req) {
+ Element result = null;
+ final Object paramObject = req.getParameter(CreateRelationshipRequest.TARGET);
+ if (paramObject instanceof Element) {
+ result = (Element) paramObject;
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
@Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(final IProgressMonitor progressMonitor, final IAdaptable info) throws ExecutionException {
final Message message = (Message) request.getElementToConfigure();
+
+ // copy the message for the undo data
+ oldMessage = EcoreUtil.copy(message);
+
final Element source = getSource(request);
final Element target = getTarget(request);
- MessageEnd previousSentEvent = (MessageEnd) request.getParameters().get(SequenceRequestConstant.PREVIOUS_EVENT);
- MessageEnd previousReceiveEvent = (MessageEnd) request.getParameters().get(SequenceRequestConstant.SECOND_PREVIOUS_EVENT);
- ExecutionOccurrenceSpecification toReplacebyMessageSent = (ExecutionOccurrenceSpecification) request.getParameters().get(SequenceRequestConstant.MESSAGE_SENTEVENT_REPLACE_EXECUTIONEVENT);
- ExecutionOccurrenceSpecification toReplacebyMessageReceive = (ExecutionOccurrenceSpecification) request.getParameters().get(SequenceRequestConstant.MESSAGE_RECEIVEEVENT_REPLACE_EXECUTIONEVENT);
+ final MessageEnd previousSentEvent = (MessageEnd) request.getParameters().get(SequenceRequestConstant.PREVIOUS_EVENT);
+ final MessageEnd previousReceiveEvent = (MessageEnd) request.getParameters().get(SequenceRequestConstant.SECOND_PREVIOUS_EVENT);
+ final ExecutionOccurrenceSpecification toReplacebyMessageSent = (ExecutionOccurrenceSpecification) request.getParameters().get(SequenceRequestConstant.MESSAGE_SENTEVENT_REPLACE_EXECUTIONEVENT);
+ final ExecutionOccurrenceSpecification toReplacebyMessageReceive = (ExecutionOccurrenceSpecification) request.getParameters().get(SequenceRequestConstant.MESSAGE_RECEIVEEVENT_REPLACE_EXECUTIONEVENT);
+ oldToReplacebyMessageSent = toReplacebyMessageSent;
+ oldToReplacebyMessageReceive = toReplacebyMessageReceive;
+ // Initialise the created message ends list
+ createdMessageEnds = new ArrayList<>(2);
IElementType elementType = request.getTypeToConfigure();
if (ElementUtil.isTypeOf(elementType, UMLElementTypes.COMPLETE_ASYNCH_CALL)) {
- createSendEvent(message, source, previousSentEvent);
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.ASYNCH_CALL_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.COMPLETE_ASYNCH_SIGNAL)) {
- createSendEvent(message, source, previousSentEvent);
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.ASYNCH_SIGNAL_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.COMPLETE_CREATE_MESSAGE)) {
- createSendEvent(message, source, previousSentEvent);
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.CREATE_MESSAGE_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.COMPLETE_DELETE_MESSAGE)) {
- createSendEvent(message, source, previousSentEvent);
- createDestroyReceiveEvent(message, target);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
+ createdMessageEnds.add(createDestroyReceiveEvent(message, target));
message.setMessageSort(MessageSort.DELETE_MESSAGE_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.COMPLETE_REPLY)) {
- createSendEvent(message, source, previousSentEvent);
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.REPLY_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.COMPLETE_SYNCH_CALL)) {
- createSendEvent(message, source, previousSentEvent);
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.SYNCH_CALL_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.FOUND_ASYNCH_CALL)) {
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.ASYNCH_CALL_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.FOUND_ASYNCH_SIGNAL)) {
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.ASYNCH_SIGNAL_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.FOUND_CREATE_MESSAGE)) {
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.CREATE_MESSAGE_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.FOUND_DELETE_MESSAGE)) {
- createDestroyReceiveEvent(message, target);
+ createdMessageEnds.add(createDestroyReceiveEvent(message, target));
message.setMessageSort(MessageSort.DELETE_MESSAGE_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.FOUND_REPLY)) {
- createReceiveEvent(message, target, previousReceiveEvent);
+ createdMessageEnds.add(createReceiveEvent(message, target, previousReceiveEvent));
message.setMessageSort(MessageSort.REPLY_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.LOST_ASYNCH_CALL)) {
- createSendEvent(message, source, previousSentEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
message.setMessageSort(MessageSort.ASYNCH_CALL_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.LOST_ASYNCH_SIGNAL)) {
- createSendEvent(message, source, previousSentEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
message.setMessageSort(MessageSort.ASYNCH_SIGNAL_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.LOST_CREATE_MESSAGE)) {
- createSendEvent(message, source, previousSentEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
message.setMessageSort(MessageSort.CREATE_MESSAGE_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.LOST_DELETE_MESSAGE)) {
- createSendEvent(message, source, previousSentEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
message.setMessageSort(MessageSort.DELETE_MESSAGE_LITERAL);
} else if (ElementUtil.isTypeOf(elementType, UMLElementTypes.LOST_REPLY)) {
- createSendEvent(message, source, previousSentEvent);
+ createdMessageEnds.add(createSendEvent(message, source, previousSentEvent));
message.setMessageSort(MessageSort.REPLY_LITERAL);
}
@@ -214,17 +289,20 @@ public class ConfigureMessageEventCommand extends ConfigureElementCommand {
toReplacebyMessageSent.getExecution().setFinish((OccurrenceSpecification) message.getSendEvent());
}
}
- if (toReplacebyMessageSent != null) {
- // the occurennce spec must disapear!
- if (toReplacebyMessageSent.getOwner() != null) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toReplacebyMessageSent);
- if (provider != null) {
- DestroyElementRequest destroyRequest = new DestroyElementRequest(toReplacebyMessageSent, false);
- ICommand destroyCommand = provider.getEditCommand(destroyRequest);
- destroyCommand.execute(new NullProgressMonitor(), null);
+ // the occurennce spec must disapear!
+ if (toReplacebyMessageSent.getOwner() != null) {
+ final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toReplacebyMessageSent);
+ if (provider != null) {
+ final DestroyElementRequest destroyRequest = new DestroyElementRequest(toReplacebyMessageSent, false);
+ final ICommand destroyCommand = provider.getEditCommand(destroyRequest);
+ destroyCommand.execute(new NullProgressMonitor(), null);
+
+ // Save the destroyed commands
+ if (null == destroyedElementsCommands) {
+ destroyedElementsCommands = new ArrayList<>();
}
+ destroyedElementsCommands.add(destroyCommand);
}
-
}
}
if (toReplacebyMessageReceive != null) {
@@ -240,72 +318,200 @@ public class ConfigureMessageEventCommand extends ConfigureElementCommand {
}
// the occurence spec must be deleted
if (toReplacebyMessageReceive.getOwner() != null) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toReplacebyMessageReceive);
+ final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toReplacebyMessageReceive);
if (provider != null) {
- DestroyElementRequest destroyRequest = new DestroyElementRequest(toReplacebyMessageReceive, false);
- ICommand destroyCommand = provider.getEditCommand(destroyRequest);
+ final DestroyElementRequest destroyRequest = new DestroyElementRequest(toReplacebyMessageReceive, false);
+ final ICommand destroyCommand = provider.getEditCommand(destroyRequest);
destroyCommand.execute(new NullProgressMonitor(), null);
+
+ // Save the destroyed commands
+ if (null == destroyedElementsCommands) {
+ destroyedElementsCommands = new ArrayList<>();
+ }
+ destroyedElementsCommands.add(destroyCommand);
}
}
}
return CommandResult.newOKCommandResult(message);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doUndo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected IStatus doUndo(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ final Message message = (Message) request.getElementToConfigure();
+ final ExecutionOccurrenceSpecification toReplacebyMessageSent = (ExecutionOccurrenceSpecification) request.getParameters().get(SequenceRequestConstant.MESSAGE_SENTEVENT_REPLACE_EXECUTIONEVENT);
+ final ExecutionOccurrenceSpecification toReplacebyMessageReceive = (ExecutionOccurrenceSpecification) request.getParameters().get(SequenceRequestConstant.MESSAGE_RECEIVEEVENT_REPLACE_EXECUTIONEVENT);
+ // Reset the message modified with the old message stored
+ message.setMessageSort(oldMessage.getMessageSort());
+ message.setSendEvent(oldMessage.getSendEvent());
+ message.setReceiveEvent(oldMessage.getReceiveEvent());
+
+ // Remove the created message ends
+ if (null != createdMessageEnds && !createdMessageEnds.isEmpty()) {
+ for (final MessageEnd createdMessage : createdMessageEnds) {
+ final EObject container = createdMessage.eContainer();
+ if (container instanceof Interaction) {
+ ((Interaction) container).getFragments().remove(createdMessage);
+ } else if (container instanceof InteractionOperand) {
+ ((InteractionOperand) container).getFragments().remove(createdMessage);
+ }
+ }
+ }
+
+ // Manage the covered life lines if needed
+ if (null != coveredLifelines && !coveredLifelines.isEmpty()) {
+ for (final Entry<Lifeline, List<MessageOccurrenceSpecification>> entry : coveredLifelines.entrySet()) {
+ for (final MessageOccurrenceSpecification addedCoveredBy : entry.getValue()) {
+ entry.getKey().getCoveredBys().remove(addedCoveredBy);
+ }
+ }
+ }
+
+ // an occurence spec must replaced?
+ if (oldToReplacebyMessageSent != null) {
+ if (oldToReplacebyMessageSent.getExecution() != null) {
+ // by the sent event of the message?
+ // this is the start?
+ if (oldToReplacebyMessageSent.getExecution().getStart().equals(oldToReplacebyMessageSent)) {
+ toReplacebyMessageSent.getExecution().setStart(oldToReplacebyMessageSent.getExecution().getStart());
+ } else {
+ // this is the finish
+ toReplacebyMessageSent.getExecution().setFinish(oldToReplacebyMessageSent.getExecution().getFinish());
+ }
+ }
+ }
+ if (oldToReplacebyMessageReceive != null) {
+ // replace by the receive message
+ if (oldToReplacebyMessageReceive.getExecution() != null) {
+ // this is the start?
+ if (oldToReplacebyMessageReceive.getExecution().getStart().equals(oldToReplacebyMessageReceive)) {
+ toReplacebyMessageReceive.getExecution().setStart(oldToReplacebyMessageReceive.getExecution().getStart());
+ } else {
+ // this is the finish
+ toReplacebyMessageReceive.getExecution().setFinish(oldToReplacebyMessageReceive.getExecution().getFinish());
+ }
+ }
+ }
+
+ // Undo the destroy elements if there was destroyed elements
+ if (null != destroyedElementsCommands && !destroyedElementsCommands.isEmpty()) {
+ for (final ICommand destroyCommand : destroyedElementsCommands) {
+ destroyCommand.undo(new NullProgressMonitor(), null);
+ }
+ }
+
+ // Clear the needed data, because this will be re-fill with the redo action
+ oldMessage = null;
+ oldToReplacebyMessageReceive = null;
+ oldToReplacebyMessageSent = null;
+ createdMessageEnds = null;
+ coveredLifelines = null;
+ destroyedElementsCommands = null;
+
+ setResult(new CommandResult(Status.OK_STATUS));
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doRedo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected IStatus doRedo(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ // Only re-execute the initial process
+ final CommandResult result = doExecuteWithResult(monitor, info);
+
+ setResult(result);
+ return result.getStatus();
+ }
/**
+ * This allows to create the destroy receive event.
+ *
* @param message
+ * The message.
* @param source
+ * The source lifeline.
+ * @return
*/
- private void createDestroyReceiveEvent(final Message message, final Element source) {
+ private DestructionOccurrenceSpecification createDestroyReceiveEvent(final Message message, final Element source) {
// Create source and target ends
- MessageEnd sendEvent = createDestroyMessageEnd(message, (Lifeline) source);
- sendEvent.setName(message.getName() + "ReceiveDestroyEvent");
+ final DestructionOccurrenceSpecification sendEvent = createDestroyMessageEnd(message, (Lifeline) source);
+ sendEvent.setName(message.getName() + "ReceiveDestroyEvent"); //$NON-NLS-1$
message.setReceiveEvent(sendEvent);
+ return sendEvent;
}
/**
+ * This allows to create the send event.
+ *
* @param message
+ * The message.
* @param source
+ * The source lifeline, gate or execution specification.
+ * @param previous
+ * The previous message end.
+ * @return The create message occurrence specification (can be <code>null</code>).
*/
- private void createSendEvent(final Message message, final Element source, final MessageEnd previous) {
+ private MessageOccurrenceSpecification createSendEvent(final Message message, final Element source, final MessageEnd previous) {
if (source instanceof Gate) {
message.setSendEvent((Gate) source);
} else if (source instanceof ExecutionSpecification) {
if (((ExecutionSpecification) source).getCovereds().size() > 0) {
- Lifeline lifeline = ((ExecutionSpecification) source).getCovereds().get(0);
- MessageEnd sendEvent = createMessageEnd(message, lifeline, previous);
- sendEvent.setName(message.getName() + "SendEvent");
+ final Lifeline lifeline = ((ExecutionSpecification) source).getCovereds().get(0);
+ final MessageOccurrenceSpecification sendEvent = createMessageEnd(message, lifeline, previous);
+ sendEvent.setName(message.getName() + "SendEvent"); //$NON-NLS-1$
message.setSendEvent(sendEvent);
+ return sendEvent;
}
} else if (source instanceof Lifeline) {
// Create source and target ends
- MessageEnd sendEvent = createMessageEnd(message, (Lifeline) source, previous);
- sendEvent.setName(message.getName() + "SendEvent");
+ final MessageOccurrenceSpecification sendEvent = createMessageEnd(message, (Lifeline) source, previous);
+ sendEvent.setName(message.getName() + "SendEvent"); //$NON-NLS-1$
message.setSendEvent(sendEvent);
+ return sendEvent;
}
+
+ return null;
}
/**
+ * This allows to create the receive event.
+ *
* @param message
- * @param target
+ * The message.
+ * @param source
+ * The source lifeline, gate or execution specification.
+ * @param previous
+ * The previous message end.
+ * @return The create message occurrence specification (can be <code>null</code>).
*/
- private void createReceiveEvent(final Message message, final Element target, final MessageEnd previous) {
+ private MessageOccurrenceSpecification createReceiveEvent(final Message message, final Element target, final MessageEnd previous) {
if (target instanceof Gate) {
message.setReceiveEvent((Gate) target);
} else if (target instanceof ExecutionSpecification) {
if (((ExecutionSpecification) target).getCovereds().size() > 0) {
- Lifeline lifeline = ((ExecutionSpecification) target).getCovereds().get(0);
- MessageEnd receiveEvent = createMessageEnd(message, lifeline, previous);
- receiveEvent.setName(message.getName() + "ReceiveEvent");
+ final Lifeline lifeline = ((ExecutionSpecification) target).getCovereds().get(0);
+ final MessageOccurrenceSpecification receiveEvent = createMessageEnd(message, lifeline, previous);
+ receiveEvent.setName(message.getName() + "ReceiveEvent"); //$NON-NLS-1$
message.setReceiveEvent(receiveEvent);
+ return receiveEvent;
}
} else if (target instanceof Lifeline) {
- MessageEnd receiveEvent = createMessageEnd(message, (Lifeline) target, previous);
- receiveEvent.setName(message.getName() + "ReceiveEvent");
+ final MessageOccurrenceSpecification receiveEvent = createMessageEnd(message, (Lifeline) target, previous);
+ receiveEvent.setName(message.getName() + "ReceiveEvent"); //$NON-NLS-1$
message.setReceiveEvent(receiveEvent);
+ return receiveEvent;
}
+
+ return null;
}
}

Back to the top