Source:
protected ICommand getAfterCreateRelationshipCommand(CreateRelationshipRequest request) { ICommand defaultCommand = super.getAfterCreateRelationshipCommand(request); View sourceView = RequestParameterUtils.getSourceView(request); View targetView = RequestParameterUtils.getTargetView(request); if (request.getElementType() instanceof ISpecializationType) { ArrayList<IElementType> elementTypesHierarchy = new ArrayList<IElementType>(); elementTypesHierarchy.add(request.getElementType()); ISpecializationType iSpecializationType = (ISpecializationType) request.getElementType(); elementTypesHierarchy.addAll(Arrays.asList(iSpecializationType.getAllSuperTypes())); if ((elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_ABSTRACTION))) || (elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_ABSTRACTION))) || (elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_ABSTRACTION)))) { if (sourceView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), sourceView, true); EMFToIEditCommandWrapper editCommandWrapper = new EMFToIEditCommandWrapper(request.getContainer(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } if (targetView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), targetView, false); EMFToIEditCommandWrapper editCommandWrapper = new EMFToIEditCommandWrapper(request.getContainer(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } } } return defaultCommand; }

Target:
protected ICommand getAfterCreateRelationshipCommand(CreateRelationshipRequest request) { ICommand defaultCommand = super.getAfterCreateRelationshipCommand(request); View sourceView = RequestParameterUtils.getSourceView(request); View targetView = RequestParameterUtils.getTargetView(request); if (request.getElementType() instanceof ISpecializationType) { ArrayList<IElementType> elementTypesHierarchy = new ArrayList<IElementType>(); elementTypesHierarchy.add(request.getElementType()); ISpecializationType iSpecializationType = (ISpecializationType) request.getElementType(); elementTypesHierarchy.addAll(Arrays.asList(iSpecializationType.getAllSuperTypes())); if ((elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_ABSTRACTION))) || (elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_ABSTRACTION))) || (elementTypesHierarchy.contains(ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_ABSTRACTION)))) { if (sourceView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), sourceView, true); EMFToIEditCommandWrapper editCommandWrapper = new EMFToCreateElementEditCommandWrapper(request.getContainer(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } if (targetView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), targetView, false); EMFToIEditCommandWrapper editCommandWrapper = new EMFToCreateElementEditCommandWrapper(request.getContainer(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } } } return defaultCommand; }