Ejemplo n.º 1
0
  /**
   * Create a MessageOccurenceSpecification and the call event when a message is created
   *
   * @generated NOT
   */
  @Override
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
      throws ExecutionException {
    if (!canExecute()) {
      throw new ExecutionException("Invalid arguments in create link command"); // $NON-NLS-1$
    }
    InteractionFragment sourceContainer =
        (InteractionFragment)
            getRequest().getParameters().get(SequenceRequestConstant.SOURCE_MODEL_CONTAINER);
    InteractionFragment targetContainer =
        (InteractionFragment)
            getRequest().getParameters().get(SequenceRequestConstant.TARGET_MODEL_CONTAINER);

    Message message =
        CommandHelper.doCreateMessage(
            container,
            MessageSort.SYNCH_CALL_LITERAL,
            getSource(),
            getTarget(),
            sourceContainer,
            targetContainer);
    if (message != null) {
      doConfigure(message, monitor, info);
      ((CreateElementRequest) getRequest()).setNewElement(message);
      return CommandResult.newOKCommandResult(message);
    }

    return CommandResult.newErrorCommandResult(
        "There is now valid container for events"); //$NON-NLS-1$
  }