blob: 31c4d85a6183f278f8e71aeb8db3da0b39b1894f [file] [log] [blame]
/**
* Copyright (c)2020 CEA LIST, Committer Name, 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
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* CEA LIST - Initial API and implementation
* Gabriel Pedroza (CEA LIST) gabriel.pedroza@cea.fr
*
*/
package org.eclipse.papyrus.pdp4eng.designer.controller.internal.processcreation;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.InputPin;
import org.eclipse.uml2.uml.OpaqueAction;
import org.eclipse.uml2.uml.Pin;
import org.eclipse.uml2.uml.UMLFactory;
public class InputPinProcessCreation implements IProcessCreation {
@Override
public Element createElement(Element inputPin, Element opaqueAction) {
if( inputPin instanceof InputPin) {
InputPin anInputPin= UMLFactory.eINSTANCE.createInputPin();
((OpaqueAction) opaqueAction).getInputValues().add(anInputPin);
anInputPin.setName(((InputPin)inputPin).getName());
if( ((Pin)inputPin).getType()!=null) {
ProcessBuilder.getInstance().createElement(((Pin)inputPin).getType(), anInputPin);
}
return anInputPin;
}
return null;
}
}