Source:
public void execute() { Object constraint = null; if (elementCreationCommand != null) { elementCreationCommand.execute(); constraint = elementCreationCommand.getICommand().getCommandResult().getReturnValue(); } if (constraint instanceof Constraint && compartment != null && type != null) { viewsCreationCommand = new CompoundCommand(); ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(new EObjectAdapter((EObject) constraint), Node.class, type.getSemanticHint(), compartment.getDiagramPreferencesHint()); CreateViewRequest request = new CreateViewRequest(descriptor); Command nodeCreationCommand = compartment.getCommand(request); viewsCreationCommand.add(nodeCreationCommand); viewsCreationCommand.add(new RefreshEditPartCommand(compartment)); if (linkedActionEditPart != null && getLinkType() != null) { IAdaptable targetAdapter = extractResult(nodeCreationCommand); if (targetAdapter != null) { IAdaptable sourceAdapter = new SemanticAdapter(null, linkedActionEditPart.getModel()); CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(getLinkType(), getLinkType().getSemanticHint(), compartment.getDiagramPreferencesHint()); CommonDeferredCreateConnectionViewCommand aLinkCommand = new CommonDeferredCreateConnectionViewCommand( editingDomain, getLinkType().getSemanticHint(), sourceAdapter, targetAdapter, compartment.getViewer(), compartment.getDiagramPreferencesHint(), linkdescriptor, null); aLinkCommand.setElement((EObject) constraint); viewsCreationCommand.add(new ICommandProxy(aLinkCommand)); } } viewsCreationCommand.execute(); } }

Target:
public void execute() { Object constraint = null; if (elementCreationCommand != null) { elementCreationCommand.execute(); constraint = elementCreationCommand.getICommand().getCommandResult().getReturnValue(); } if (constraint instanceof Constraint && compartment != null && type != null) { viewsCreationCommand = new CompoundCommand(); ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(new EObjectAdapter((EObject) constraint), Node.class, type.getSemanticHint(), compartment.getDiagramPreferencesHint()); CreateViewRequest request = new CreateViewRequest(descriptor); Command nodeCreationCommand = compartment.getCommand(request); viewsCreationCommand.add(nodeCreationCommand); if (linkedActionEditPart != null && getLinkType() != null) { IAdaptable targetAdapter = extractResult(nodeCreationCommand); if (targetAdapter != null) { IAdaptable sourceAdapter = new SemanticAdapter(null, linkedActionEditPart.getModel()); CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(getLinkType(), getLinkType().getSemanticHint(), compartment.getDiagramPreferencesHint()); CommonDeferredCreateConnectionViewCommand aLinkCommand = new CommonDeferredCreateConnectionViewCommand( editingDomain, getLinkType().getSemanticHint(), sourceAdapter, targetAdapter, compartment.getViewer(), compartment.getDiagramPreferencesHint(), linkdescriptor, null); aLinkCommand.setElement((EObject) constraint); viewsCreationCommand.add(new ICommandProxy(aLinkCommand)); } } viewsCreationCommand.execute(); } }