blob: 6cc2d6de2b401f1ed105d18fb15c311eb89310e4 [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2019 CEA LIST, 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:
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation
*
*****************************************************************************/
import org.eclipse.papyrus.uml.m2m.qvto.common.blackboxes.ecore.EcoreHelper;
import org.eclipse.papyrus.interoperability.sysml16.sysml14.blackboxes.notation.NotationBlackboxHelper;
import org.eclipse.papyrus.interoperability.sysml16.sysml14.SysMLDiagramsUtils;
import org.eclipse.papyrus.interoperability.sysml16.sysml14.SysMLDiagramsConstants;
import org.eclipse.papyrus.interoperability.sysml16.sysml14.SysMLUtils;
modeltype notation "strict" uses 'http://www.eclipse.org/gmf/runtime/1.0.2/notation';
modeltype UML "strict" uses 'http://www.eclipse.org/uml2/5.0.0/UML';
modeltype ecore "strict" uses 'http://www.eclipse.org/emf/2002/Ecore';
modeltype SysML14 "strict" uses 'http://www.eclipse.org/papyrus/sysml/1.4/SysML';
modeltype SysML16 "strict" uses 'http://www.eclipse.org/papyrus/sysml/1.6/SysML';
modeltype nattable "strict" uses 'http://www.eclipse.org/papyrus/nattable/model';
transformation SysMLBlockDefinitionDiagram(in umlFile : UML, in inS16Profile : SysML16, in requirementNatTableS14 : nattable, in allocationNatTableS14 : nattable, in requirementTreeNatTableS14 : nattable, in requirementNatTableS16 : nattable, in allocationNatTableS16 : nattable, in requirementTreeNatTableS16 : nattable, inout notationFile : notation);
// Define needed constants
property diagramType:String = "PapyrusUMLClassDiagram";
property oldRepresentationKindBlockDefinitionDiagram = "org.eclipse.papyrus.sysml14.diagram.blockdefinition";
property representationKindBlockDefinitionDiagram = "org.eclipse.papyrus.sysml16.diagram.blockdefinition";
mapping notation::Diagram::fromSysML14BlockDefinitionDiagram() : notation::Diagram when {self.type = diagramType and getPapyrusDiagramStyle(self) = oldRepresentationKindBlockDefinitionDiagram} {
init{
result := self;
}
// Create the annotation for versionning
var model:UML::Model := umlFile.rootObjects()[uml::Model]->any(true);
result.eAnnotations += model.createEAnnotationForVersioning();
// Modify or create the compatibility version
setOrCreateCompatibilityVersion(result);
// Add the viewpoint configuration to the papyrus view style
addPapyrusDiagramStyleConfiguration(result, model, representationKindBlockDefinitionDiagram);
}