blob: c3d009ebdd525c39dc23fdb82fb6c6ed5df36038 [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.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.UMLPackage;
/**
* Creates an abstraction from Data.
*
*/
public class ProcessDFDCreateCommand extends RecordingCommand {
protected NamedElement selectedElement;
private Package owner;
private Activity reqDFDSource;
public ProcessDFDCreateCommand(TransactionalEditingDomain domain, Package owner,Activity ReqDFDSource) {
super(domain, "AbstractDataCreateCommand");
this.owner=owner;
this.reqDFDSource=ReqDFDSource;
}
@Override
protected void doExecute() {
RulesInformation rulesInformation= new RulesInformation(new Shell());
DataStoreProcessCreation dataStoreProcessCreation= new DataStoreProcessCreation();
rulesInformation.open();
dataStoreProcessCreation.generateParameterForSeek(rulesInformation.generateSeekAsParameter());
dataStoreProcessCreation.generateParameterForSource(rulesInformation.generateSourceAsParameter());
ProcessBuilder.getInstance().getProcessTransfo().put(UMLPackage.eINSTANCE.getDataStoreNode(), dataStoreProcessCreation);
ProcessBuilder.getInstance().createElement(this.reqDFDSource, this.owner);
}
}