blob: 01e838d894a47f5e3761c0ceff7ac7721a390008 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*****************************************************************************
* Copyright (c) 2016 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
*****************************************************************************/
import Rhapsody2PapyrusSemanticElements;
import RhapsodyUtils;
import SysMLRhapsodyUtils;
import SysML11ParametricDiagram;
import SysML11BlockDefinitionDiagram;
import SysML11InternalBlockDiagram;
import org.eclipse.papyrus.migration.rhapsody.blackboxes.Rhapsody2PapyrusNotationBlackboxes;
modeltype umlrhapsody "strict" uses 'http://www.eclipse.org/Papyrus/UMLRhapsody/1.0.0';
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 sysml11 "strict" uses 'http://www.eclipse.org/papyrus/0.7.0/SysML';
modeltype ecore "strict" uses 'http://www.eclipse.org/emf/2002/Ecore';
modeltype UMLPrimitivesTypes "strict" uses 'http://www.eclipse.org/uml2/5.0.0/Types' ;
modeltype properties "strict" uses 'http://www.eclipse.org/papyrus/internationalization/model';
/**
*
* This transformation does the SysML 1.1 Diagram creation from a Rhapsody Model
*
*/
transformation SysML11Diagrams(in semantics : umlrhapsody, out graphics : notation, inout model:uml,in Sysml11Profile:sysml11, in primitives:UMLPrimitivesTypes, inout labels:properties)
access transformation Rhapsody2PapyrusSemanticElements(in inModel:umlrhapsody, out outModel:uml, in primitives:UMLPrimitivesTypes)
extends Rhapsody2PapyrusSemanticElements(in inModel:umlrhapsody, out outModel:uml, in primitives:UMLPrimitivesTypes)
{
main() {
if(sysml11<>null){
if(isContainingSysMLRhapsodyStereotypeReference(semantics.objectsOfKind(EObject))){
log("SysML Diagrams Mapping");
var diagrams:Set(IDiagram):= semantics.objects()[IDiagram];
var iProject:Set(IProject):=semantics.rootObjects()[IProject];
diagrams->map iDiagramToPapyrusSysML11Diagram(iProject->any(true));//we assume that there is only one IProject in the model
//managing internationalization (labels of SysML Rhaposdy Diagrams)
var internationalizationLibrary:InternationalizationLibrary:=labels.rootObjects()->selectByKind(InternationalizationLibrary)->any(true);
if(internationalizationLibrary.oclIsUndefined()){
internationalizationLibrary:= object InternationalizationLibrary@labels{}
};
diagrams->forEach(current){
var res:Diagram:= current.resolveoneIn(rhapsodymetamodel::IDiagram::iDiagramToPapyrusSysML11Diagram);
if(res<>null and not current.displayName.oclIsUndefined() and current.displayName.size()<>0){
internationalizationLibrary.entries+= object InternationalizationEntry{
key:=res;
value:=current.displayName;
}
}
};
log("End of SysML Diagram Mapping");
}else{
log("There is not SysML Stereotype applied on the Rhapsody model.");
};
}
}
}
/**
*
* This method do the mapping between Rhapsody SysML Diagram and Papyrus SysML11 Diagram
*/
mapping rhapsodymetamodel::IDiagram::iDiagramToPapyrusSysML11Diagram(rpyProject:IProject):Diagram@graphics disjuncts
rhapsodymetamodel::IDiagram::iDiagramToSysML11BlockDefinitionDiagram,
rhapsodymetamodel::IDiagram::iDiagramToSysML11InternalBlockDiagram,
rhapsodymetamodel::IDiagram::iDiagramToSysML11ParametricDiagram
{}
|