Source:
protected Command doGetCommand(Request request, EditPart targetEditPart) { List<EObject> sourceElements = getSourceEObjects(request); if (sourceElements.size() != 1) { return null; } final EObject sourceElement = sourceElements.get(0); if (!(sourceElement instanceof Signal)) { return null; } final EObject targetElement = getTargetSemanticElement(targetEditPart); if (!(targetElement instanceof Classifier)) { return null; } final Set<Path> paths = GenericUml2GraphServices.getInstance().proposedActionsFromDnd(sourceElement.eClass(), targetElement.eClass()); if(Activator.log.isDebugEnabled()){ Activator.log.debug("paths size "+paths.size()); } IElementEditService provider = ElementEditServiceUtils.getCommandProvider(sourceElement); if(provider == null) { return null; } Command resultCommand = new Command(getLabel()) { @SuppressWarnings("unchecked") @Override public void execute() { EObject container= targetElement; for(Path p : paths){ if(p.getName().startsWith("ownedReception")){ for(int i=0; i< p.getWay().size()-1 ; i++){ EdgeEReference er = p.getWay().get(i); if(Activator.log.isDebugEnabled()){ Activator.log.debug("creation of "+er.geteReference().getName()+"\tin "+container.toString()+"\twith "+ er.getTargetConcretEclasse().getInstanceTypeName()); } EObject o = EMFCoreUtil.create(container, er.geteReference(), er.getTargetConcretEclasse()); container=o; container.eSet(container.eClass().getEStructuralFeature("name"), er.geteReference().getName()); } EReference er = p.getWay().get(p.getWay().size()-1).geteReference(); if (FeatureMapUtil.isMany(container,er)) { ((Collection) container.eGet(er)).add(sourceElement); } else { container.eSet(er, sourceElement); } } } } }; return resultCommand; }

Target:
protected Command doGetCommand(Request request, EditPart targetEditPart) { List<EObject> sourceElements = getSourceEObjects(request); if (sourceElements.size() != 1) { return null; } final EObject sourceElement = sourceElements.get(0); if (!(sourceElement instanceof Signal)) { return null; } final EObject targetElement = getTargetSemanticElement(targetEditPart); if (!(targetElement instanceof org.eclipse.uml2.uml.Class)) { return null; } final Set<Path> paths = GenericUml2GraphServices.getInstance().proposedActionsFromDnd(sourceElement.eClass(), targetElement.eClass()); if(Activator.log.isDebugEnabled()){ Activator.log.debug("paths size "+paths.size()); } IElementEditService provider = ElementEditServiceUtils.getCommandProvider(sourceElement); if(provider == null) { return null; } Command resultCommand = new Command(getLabel()) { @SuppressWarnings("unchecked") @Override public void execute() { EObject container= targetElement; for(Path p : paths){ if(p.getName().startsWith("ownedReception")){ for(int i=0; i< p.getWay().size()-1 ; i++){ EdgeEReference er = p.getWay().get(i); if(Activator.log.isDebugEnabled()){ Activator.log.debug("creation of "+er.geteReference().getName()+"\tin "+container.toString()+"\twith "+ er.getTargetConcretEclasse().getInstanceTypeName()); } EObject o = EMFCoreUtil.create(container, er.geteReference(), er.getTargetConcretEclasse()); container=o; container.eSet(container.eClass().getEStructuralFeature("name"), er.geteReference().getName()); } EReference er = p.getWay().get(p.getWay().size()-1).geteReference(); if (FeatureMapUtil.isMany(container,er)) { ((Collection) container.eGet(er)).add(sourceElement); } else { container.eSet(er, sourceElement); } } } } }; return resultCommand; }