Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2017-01-12 14:47:15 +0000
committervincent lorenzo2017-01-17 15:48:13 +0000
commit2ff7b6dde56a5f78f3eb73e6ec65ccd24885647d (patch)
tree0915ddd7bc6d2ec613d3ae12342b9b74060b33fe /extraplugins
parent724cff2f7b93a2221e0cf333cd2e7d9e268826f4 (diff)
downloadorg.eclipse.papyrus-2ff7b6dde56a5f78f3eb73e6ec65ccd24885647d.tar.gz
org.eclipse.papyrus-2ff7b6dde56a5f78f3eb73e6ec65ccd24885647d.tar.xz
org.eclipse.papyrus-2ff7b6dde56a5f78f3eb73e6ec65ccd24885647d.zip
Bug 510363: [Importer][Rhapsody] Imported BDD doesn't contains Actor, Event and Package
Change-Id: Ib91a8ad1a6acaca497b6b36b4f4cd19d42c1bf2f Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'extraplugins')
-rwxr-xr-xextraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateIMatrixInstance_FromScopeHandles_IEvent.gifbin0 -> 223 bytes
-rwxr-xr-xextraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateIMatrixInstance_ToScopeHandles_IEvent.gifbin0 -> 223 bytes
-rwxr-xr-xextraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateITableInstance_ScopeHandles_IEvent.gifbin0 -> 223 bytes
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/IMatrixInstanceItemProvider.java10
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/ITableInstanceItemProvider.java5
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/model/Rhapsody.ecore2
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/IEvent.java2
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/IEventImpl.java11
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/rhapsodymetamodel.ecore2
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/util/UMLRhapsodySwitch.java1
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto24
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto92
12 files changed, 135 insertions, 14 deletions
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateIMatrixInstance_FromScopeHandles_IEvent.gif b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateIMatrixInstance_FromScopeHandles_IEvent.gif
new file mode 100755
index 00000000000..7f95c3219c2
--- /dev/null
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateIMatrixInstance_FromScopeHandles_IEvent.gif
Binary files differ
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateIMatrixInstance_ToScopeHandles_IEvent.gif b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateIMatrixInstance_ToScopeHandles_IEvent.gif
new file mode 100755
index 00000000000..7f95c3219c2
--- /dev/null
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateIMatrixInstance_ToScopeHandles_IEvent.gif
Binary files differ
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateITableInstance_ScopeHandles_IEvent.gif b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateITableInstance_ScopeHandles_IEvent.gif
new file mode 100755
index 00000000000..fc9baba599a
--- /dev/null
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/icons/full/ctool16/CreateITableInstance_ScopeHandles_IEvent.gif
Binary files differ
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/IMatrixInstanceItemProvider.java b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/IMatrixInstanceItemProvider.java
index 51d81956645..bd4597caa1d 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/IMatrixInstanceItemProvider.java
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/IMatrixInstanceItemProvider.java
@@ -402,6 +402,11 @@ public class IMatrixInstanceItemProvider extends MatrixInstancesTypeItemProvider
newChildDescriptors.add
(createChildParameter
(UMLRhapsodyPackage.eINSTANCE.getIMatrixInstance_FromScopeHandles(),
+ UMLRhapsodyFactory.eINSTANCE.createIEvent()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (UMLRhapsodyPackage.eINSTANCE.getIMatrixInstance_FromScopeHandles(),
UMLRhapsodyFactory.eINSTANCE.createIInteractionOperand()));
newChildDescriptors.add
@@ -612,6 +617,11 @@ public class IMatrixInstanceItemProvider extends MatrixInstancesTypeItemProvider
newChildDescriptors.add
(createChildParameter
(UMLRhapsodyPackage.eINSTANCE.getIMatrixInstance_ToScopeHandles(),
+ UMLRhapsodyFactory.eINSTANCE.createIEvent()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (UMLRhapsodyPackage.eINSTANCE.getIMatrixInstance_ToScopeHandles(),
UMLRhapsodyFactory.eINSTANCE.createIInteractionOperand()));
newChildDescriptors.add
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/ITableInstanceItemProvider.java b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/ITableInstanceItemProvider.java
index fa82452afde..bd9a9faa1dd 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/ITableInstanceItemProvider.java
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel.edit/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/provider/ITableInstanceItemProvider.java
@@ -381,6 +381,11 @@ public class ITableInstanceItemProvider extends TableInstancesTypeItemProvider {
newChildDescriptors.add
(createChildParameter
(UMLRhapsodyPackage.eINSTANCE.getITableInstance_ScopeHandles(),
+ UMLRhapsodyFactory.eINSTANCE.createIEvent()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (UMLRhapsodyPackage.eINSTANCE.getITableInstance_ScopeHandles(),
UMLRhapsodyFactory.eINSTANCE.createIInteractionOperand()));
newChildDescriptors.add
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/model/Rhapsody.ecore b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/model/Rhapsody.ecore
index 3d8bbebb258..4d051d09459 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/model/Rhapsody.ecore
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/model/Rhapsody.ecore
@@ -1696,7 +1696,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="description" eType="#//IDescription"
containment="true"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="IEvent" eSuperTypes="#//IInterfaceItem #//M_subjectType #//M_pFormalMessageType #//ConveyedType #//TargetType">
+ <eClassifiers xsi:type="ecore:EClass" name="IEvent" eSuperTypes="#//IInterfaceItem #//M_subjectType #//M_pFormalMessageType #//ConveyedType #//TargetType #//M_pModelObjectType">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="myState" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/IEvent.java b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/IEvent.java
index 0e0b7be7666..7cb55efebd5 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/IEvent.java
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/IEvent.java
@@ -43,7 +43,7 @@ import org.eclipse.emf.common.util.EList;
* @model
* @generated
*/
-public interface IEvent extends IInterfaceItem, M_subjectType, M_pFormalMessageType, ConveyedType, TargetType {
+public interface IEvent extends IInterfaceItem, M_subjectType, M_pFormalMessageType, ConveyedType, TargetType, M_pModelObjectType {
/**
* Returns the value of the '<em><b>Id</b></em>' attribute.
* <!-- begin-user-doc -->
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/IEventImpl.java b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/IEventImpl.java
index 46ce05fef6b..a2c37e3d767 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/IEventImpl.java
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/IEventImpl.java
@@ -39,6 +39,7 @@ import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.IPropertyContain
import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.ITag;
import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.IVariable;
import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.M_pFormalMessageType;
+import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.M_pModelObjectType;
import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.M_subjectType;
import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.TargetType;
import org.eclipse.papyrus.migration.rhapsody.rhapsodymetamodel.UMLRhapsodyPackage;
@@ -1143,6 +1144,11 @@ public class IEventImpl extends IInterfaceItemImpl implements IEvent {
default: return -1;
}
}
+ if (baseClass == M_pModelObjectType.class) {
+ switch (derivedFeatureID) {
+ default: return -1;
+ }
+ }
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
@@ -1176,6 +1182,11 @@ public class IEventImpl extends IInterfaceItemImpl implements IEvent {
default: return -1;
}
}
+ if (baseClass == M_pModelObjectType.class) {
+ switch (baseFeatureID) {
+ default: return -1;
+ }
+ }
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/rhapsodymetamodel.ecore b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/rhapsodymetamodel.ecore
index a476577ac9f..10ab905059a 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/rhapsodymetamodel.ecore
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/impl/rhapsodymetamodel.ecore
@@ -1693,7 +1693,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="description" eType="#//IDescription"
containment="true"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="IEvent" eSuperTypes="#//IInterfaceItem #//M_subjectType #//M_pFormalMessageType #//ConveyedType #//TargetType">
+ <eClassifiers xsi:type="ecore:EClass" name="IEvent" eSuperTypes="#//IInterfaceItem #//M_subjectType #//M_pFormalMessageType #//ConveyedType #//TargetType #//M_pModelObjectType">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="myState" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/util/UMLRhapsodySwitch.java b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/util/UMLRhapsodySwitch.java
index b0cee127a48..dc1c4ac7da4 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/util/UMLRhapsodySwitch.java
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.metamodel/src-gen/org/eclipse/papyrus/migration/rhapsody/rhapsodymetamodel/util/UMLRhapsodySwitch.java
@@ -1072,6 +1072,7 @@ public class UMLRhapsodySwitch<T> extends Switch<T> {
if (result == null) result = caseM_pFormalMessageType(iEvent);
if (result == null) result = caseConveyedType(iEvent);
if (result == null) result = caseTargetType(iEvent);
+ if (result == null) result = caseM_pModelObjectType(iEvent);
if (result == null) result = caseIClassifier(iEvent);
if (result == null) result = caseIUnit(iEvent);
if (result == null) result = caseIModelElement(iEvent);
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto
index a2b77c1b276..f99ff64f021 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/RhapsodyToPapyrusDiagamCommon.qvto
@@ -143,6 +143,30 @@ mapping umlrhapsody::CGIClass::toListCompartment(papyrusCompartmentName:String,
eAnnotations+=createCSSForceValue("visible");
}
+//TODO : merge me with previous one
+mapping umlrhapsody::CGIBasicClass::toListCompartment(papyrusCompartmentName:String, rhapsodyCompartmentName:String) : notation::ListCompartment{
+ type:=papyrusCompartmentName;
+ styles := object DrawerStyle{};
+ styles += object TitleStyle{};
+ styles += object SortingStyle{};
+ styles += object FilteringStyle{};
+ //we hide the compartment by default. We show it only if it the equivalent compartment is shown in Rhapsody
+ visible:=false;
+
+ if(rhapsodyCompartmentName<>null){
+ visible:=self.Compartments->selectByKind(CGICompartment)->select(cpt | cpt.m_name=rhapsodyCompartmentName)->notEmpty();
+ };
+ if(visible){
+ var showCompartmentTitleProperty:umlrhapsody::IProperty :=self[CGIBasicClass].properties.Subjects->select(subject | subject.Name="General").Metaclasses->select(metaclass | metaclass.Name="Graphics").Properties->select(p | p.Name="ShowCompartmentsTitle")->any(true);
+ if((not showCompartmentTitleProperty.oclIsUndefined()) and showCompartmentTitleProperty.Value="False"){
+ eAnnotations+= object EAnnotation { source:="PapyrusCSSForceValue" ; details+=object EStringToStringMapEntry { key:="showTitle"; value:="false"}};
+ };
+ };
+
+ //force value to avoid impact of CSS and get the same display between Rhapsody and Papyrus
+ eAnnotations+=createCSSForceValue("visible");
+}
+
/**
* Helper to create an EAnnotation to force a value and ignore CSS. It is used to get the same diaply between Rhapsody model and Papyrus model, ignoring CSS applied on the model
*/
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto
index 7e616e6890b..55e804d92bf 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11BlockDefinitionDiagram.qvto
@@ -51,7 +51,13 @@ mapping rhapsodymetamodel::IDiagram::iDiagramToSysML11BlockDefinitionDiagram(rpy
result:=self.map createAndInitDiagram(rpyProject,getPapyrusDiagramType(), owner, owner);
}
- children:= self.graphicChart.graphElements.map toSysML11BlockDefinitionDiagramShape();
+ //1. find some objects
+ var cgiClassChart:CGIClassChart:=self.graphicChart->oclAsSet().selectByType(CGIClassChart)->any(true);
+ var cgiClass:CGIClass:=cgiClassChart.graphElements->selectByType(CGIClass)->any(true);
+ var cgiDiagramFrame:CGIDiagramFrame:=cgiClassChart.graphElements->selectByType(CGIDiagramFrame)->any(true);
+
+
+ children:= self.graphicChart.graphElements.map toSysML11BlockDefinitionDiagramShape(cgiClassChart, cgiClass->asSequence());
edges:=self.graphicChart.graphElements.map toSysML11BlockDefinitionDiagramEdge();
}
@@ -208,8 +214,13 @@ type:=
/**
*
* This mapping allows to create all views in a Papyrus SysML 1.1 BDD according to the Rhapsody Model
+* @param
+* cgiClassChart : the class chart of the diagram, it is useful to find child to create for the created element
+* @param
+* rpyAllowedParent : the list of the allowed Rhapsody parent to manage the object.
+* if the Rhapsody parent is not in this list, the object won't be mapped
*/
-mapping umlrhapsody::GraphElementsType::toSysML11BlockDefinitionDiagramShape() : Shape
+mapping umlrhapsody::GraphElementsType::toSysML11BlockDefinitionDiagramShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape
disjuncts
umlrhapsody::CGIGenericElement::toSysML11BDDDataTypeShape, //TODO split with value type
umlrhapsody::CGIGenericElement::toSysML11BDDUnitShape,
@@ -218,7 +229,10 @@ mapping umlrhapsody::GraphElementsType::toSysML11BlockDefinitionDiagramShape() :
umlrhapsody::CGIGenericElement::toSysML11BDDBlockShape,
umlrhapsody::CGIClass::toSysML11BDDBlockShape,
umlrhapsody::CGIClass::toSysML11BDDConstraintBlockShape,
- umlrhapsody::CGIClass::toSysML11BDDFlowSpecificationShape
+ umlrhapsody::CGIClass::toSysML11BDDFlowSpecificationShape,
+ umlrhapsody::CGIBasicClass::toSysML11BDDActorShape,
+ umlrhapsody::CGIPackage::toSysML11BDDPackageShape,
+ umlrhapsody::CGIGenericElement::toSysML11BDDSignalShape
{}
mapping umlrhapsody::GraphElementsType::toSysML11BlockDefinitionDiagramEdge() : Edge
@@ -229,7 +243,7 @@ mapping umlrhapsody::GraphElementsType::toSysML11BlockDefinitionDiagramEdge() :
/**
* This mapping creates the Block Shape with its compartment and their children
*/
-mapping umlrhapsody::CGIGenericElement::toSysML11BDDBlockShape() : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLClass()}{
+mapping umlrhapsody::CGIGenericElement::toSysML11BDDBlockShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLClass() and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
type:="shape_sysml_block_as_classifier";
element := self.m_pModelObject.resolveone().oclAsType(EObject);
var decorationNode:notation::DecorationNode:= object DecorationNode{type:="label_sysml_block_name"};
@@ -260,7 +274,7 @@ mapping umlrhapsody::CGIGenericElement::toSysML11BDDBlockShape() : Shape when {s
/**
* This mapping creates the Block Shape with its compartment and their children
*/
-mapping umlrhapsody::CGIClass::toSysML11BDDBlockShape() : Shape when {self.oclIsTypeOf(CGIClass) and self.m_pParent<>null and self.m_pModelObject.oclIsTypeOf(IClass) and not (self.m_pModelObject.oclAsType(IClass).isSysMLFlowSpecification() or self.m_pModelObject.oclAsType(IClass).isSysMLConstraintBlock()) }{
+mapping umlrhapsody::CGIClass::toSysML11BDDBlockShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape when {self.oclIsTypeOf(CGIClass) and self.m_pParent<>null and self.m_pModelObject.oclIsTypeOf(IClass) and not (self.m_pModelObject.oclAsType(IClass).isSysMLFlowSpecification() or self.m_pModelObject.oclAsType(IClass).isSysMLConstraintBlock()) and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
var res:Boolean= self.m_pModelObject.oclIsTypeOf(IClass);
type:="shape_sysml_block_as_classifier";
@@ -293,7 +307,7 @@ mapping umlrhapsody::CGIClass::toSysML11BDDBlockShape() : Shape when {self.oclIs
* This mapping creates the Block Shape with its compartment and their children
*/
//TODO : merge me with previous one ?
-mapping umlrhapsody::CGIClass::toSysML11BDDConstraintBlockShape() : Shape when {self.oclIsTypeOf(CGIClass) and self.m_pParent<>null and self.m_pModelObject.oclIsTypeOf(IClass) and self.m_pModelObject.oclAsType(IClass).isSysMLConstraintBlock()}{
+mapping umlrhapsody::CGIClass::toSysML11BDDConstraintBlockShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape when {self.oclIsTypeOf(CGIClass) and self.m_pParent<>null and self.m_pModelObject.oclIsTypeOf(IClass) and self.m_pModelObject.oclAsType(IClass).isSysMLConstraintBlock() and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
// <children xmi:type="notation:Shape" xmi:id="_Mr2uIIlmEeaNf9-vLHMoKw" type="shape_sysml_flowspecification_as_classifier">
// <children xmi:type="notation:DecorationNode" xmi:id="_Mr3VMIlmEeaNf9-vLHMoKw" type="label_sysml_flowspecification_name"/>
@@ -343,7 +357,7 @@ mapping umlrhapsody::CGIClass::toSysML11BDDConstraintBlockShape() : Shape when {
* This mapping creates the Block Shape with its compartment and their children
*/
//TODO : merge me with previous one ?
-mapping umlrhapsody::CGIClass::toSysML11BDDFlowSpecificationShape() : Shape when {self.oclIsTypeOf(CGIClass) and self.m_pParent<>null and self.m_pModelObject.oclIsTypeOf(IClass) and self.m_pModelObject.oclAsType(IClass).isSysMLFlowSpecification()}{
+mapping umlrhapsody::CGIClass::toSysML11BDDFlowSpecificationShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape when {self.oclIsTypeOf(CGIClass) and self.m_pParent<>null and self.m_pModelObject.oclIsTypeOf(IClass) and self.m_pModelObject.oclAsType(IClass).isSysMLFlowSpecification() and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
// <children xmi:type="notation:Shape" xmi:id="_Mr2uIIlmEeaNf9-vLHMoKw" type="shape_sysml_flowspecification_as_classifier">
// <children xmi:type="notation:DecorationNode" xmi:id="_Mr3VMIlmEeaNf9-vLHMoKw" type="label_sysml_flowspecification_name"/>
@@ -382,7 +396,7 @@ mapping umlrhapsody::CGIClass::toSysML11BDDFlowSpecificationShape() : Shape when
layoutConstraint:= object Bounds{ x:=getX(self); y:=getY(self); width :=getRectangleWidth(self); height := getRectangleHeight(self)};
}
-mapping umlrhapsody::CGIGenericElement::toSysML11BDDUnitShape() : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLInstanceSpecification() and self.m_pModelObject.oclAsType(IType).isSysMLUnit()}{
+mapping umlrhapsody::CGIGenericElement::toSysML11BDDUnitShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLInstanceSpecification() and self.m_pModelObject.oclAsType(IType).isSysMLUnit() and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
type:="shape_sysml_unit_as_classifier";
element := self.m_pModelObject.resolveone().oclAsType(EObject);
var decorationNode:notation::DecorationNode:= object DecorationNode{type:="label_sysml_unit_name"};
@@ -390,7 +404,7 @@ mapping umlrhapsody::CGIGenericElement::toSysML11BDDUnitShape() : Shape when {se
//TODO : add compartment as hidden
layoutConstraint:= object Bounds{ x:=getX(self); y:=getY(self); width :=getRectangleWidth(self); height := getRectangleHeight(self)};
}
-mapping umlrhapsody::CGIGenericElement::toSysML11BDDDimensionShape() : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLInstanceSpecification() and self.m_pModelObject.oclAsType(IType).isSysMLDimension()}{
+mapping umlrhapsody::CGIGenericElement::toSysML11BDDDimensionShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLInstanceSpecification() and self.m_pModelObject.oclAsType(IType).isSysMLDimension() and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
type:="shape_sysml_dimension_as_classifier";
element := self.m_pModelObject.resolveone().oclAsType(EObject);
var decorationNode:notation::DecorationNode:= object DecorationNode{type:="label_sysml_dimension_name"};
@@ -404,7 +418,7 @@ mapping umlrhapsody::CGIGenericElement::toSysML11BDDDimensionShape() : Shape whe
/**
* map the Rhapsody enumeration representation to the Papyrus Enumeration
*/
-mapping umlrhapsody::CGIGenericElement::toSysML11BDDEnumerationShape() : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLEnumeration()}{
+mapping umlrhapsody::CGIGenericElement::toSysML11BDDEnumerationShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLEnumeration() and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
type:="shape_uml_enumeration_as_classifier";
element := self.m_pModelObject.resolveone().oclAsType(EObject);
var decorationNode:notation::DecorationNode:= object DecorationNode{type:="label_uml_namedelement_name"};
@@ -415,7 +429,7 @@ mapping umlrhapsody::CGIGenericElement::toSysML11BDDEnumerationShape() : Shape w
layoutConstraint:= object Bounds{ x:=getX(self); y:=getY(self); width :=getRectangleWidth(self); height := getRectangleHeight(self)};
}
-mapping umlrhapsody::CGIGenericElement::toSysML11BDDDataTypeShape() : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLDataType()}{
+mapping umlrhapsody::CGIGenericElement::toSysML11BDDDataTypeShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)) : Shape when {self.m_pModelObject.oclIsKindOf(IType) and self.m_pModelObject.oclAsType(IType).isUMLDataType() and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
type:="shape_uml_datatype_as_classifier";
element := self.m_pModelObject.resolveone().oclAsType(EObject);
var decorationNode:notation::DecorationNode:= object DecorationNode{type:="label_uml_namedelement_name"};
@@ -763,4 +777,60 @@ mapping umlrhapsody::CGIAssociationEnd::toSysML11BDDAssociationEdge() : Connecto
eAnnotations+=createCSSForceValue("routing");
}
+/**
+* Create the Actor Shape
+*/
+mapping umlrhapsody::CGIBasicClass::toSysML11BDDActorShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)):notation::Shape when {self.m_pModelObject.oclIsTypeOf(IActor) and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
+ element := self.m_pModelObject.resolveone().oclAsType(EObject);
+ type:="shape_uml_actor_as_classifier";
+ children+= object DecorationNode{
+ type:="label_uml_namedelement_name";
+ };
+ children+=self.map toListCompartment("compartment_uml_property_as_list",null);
+ children+=self.map toListCompartment("compartment_uml_operation_as_list",null);
+ layoutConstraint:= object Bounds{ x:=getX(self); y:=getY(self); width :=getRectangleWidth(self); height := getRectangleHeight(self)};
+}
+
+/**
+* Create the package shape
+*
+*/
+mapping umlrhapsody::CGIPackage::toSysML11BDDPackageShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)):notation::Shape when {self.m_pModelObject.oclIsTypeOf(ISubsystem) and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
+ element := self.m_pModelObject.resolveone().oclAsType(EObject);
+ type:="Package_Shape";
+ children+= object DecorationNode{
+ type:="Package_NameLabel";
+ };
+ var blockPropertyStructure:BasicCompartment:= object BasicCompartment {
+ type:="Package_PackagedElementCompartment";
+ styles+=object TitleStyle{};
+ layoutConstraint:=object Bounds{};
+ };
+ layoutConstraint:= object Bounds{ x:=getX(self); y:=getY(self); width :=getRectangleWidth(self); height := getRectangleHeight(self)};
+
+ //create package contents
+
+ blockPropertyStructure.children+=cgiClassChart.graphElements->select(a | a.isAllowedAsCompartmentChildren(blockPropertyStructure)).map toSysML11BlockDefinitionDiagramShape(cgiClassChart, self->asSequence());
+ children+=blockPropertyStructure;
+}
+
+/**
+* Returns true when the graph element can be set as a children of a given compartment
+*/
+query umlrhapsody::GraphElementsType::isAllowedAsCompartmentChildren(cpt:BasicCompartment):Boolean{
+ return not self.oclIsTypeOf(CGIPortConnector);
+}
+/**
+* Map the CGIGenericElement to a Signal Shape
+*/
+mapping umlrhapsody::CGIGenericElement::toSysML11BDDSignalShape(cgiClassChart:CGIClassChart, rpyAllowedParent:Sequence(GraphElementsType)):notation::Shape when{self.m_pModelObject.oclIsTypeOf(IEvent) and self.m_pParent.oclIsKindOf(GraphElementsType) and rpyAllowedParent->includes(self.m_pParent.oclAsType(GraphElementsType))}{
+ element := self.m_pModelObject.resolveone().oclAsType(EObject);
+ type:="shape_uml_signal_as_classifier";
+ children+= object DecorationNode{
+ type:="label_uml_namedelement_name";
+ };
+ children+=self.map toListCompartment("compartment_uml_property_as_list",null);
+ children+=self.map toListCompartment("compartment_uml_operation_as_list",null);
+ layoutConstraint:= object Bounds{ x:=getX(self); y:=getY(self); width :=getRectangleWidth(self); height := getRectangleHeight(self)};
+} \ No newline at end of file

Back to the top