| /***************************************************************************** |
| * 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 SysMLInternalBlockDiagram(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 = "CompositeStructure"; |
| property oldRepresentationKindInternalBlockDiagram = "org.eclipse.papyrus.sysml14.diagram.internalblock"; |
| property representationKindInternalBlockDiagram = "org.eclipse.papyrus.sysml16.diagram.internalblock"; |
| |
| mapping notation::Diagram::fromSysML14InternalBlockDiagram() : notation::Diagram when {self.type = diagramType and getPapyrusDiagramStyle(self) = oldRepresentationKindInternalBlockDiagram} { |
| 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, representationKindInternalBlockDiagram); |
| } |