Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins')
-rwxr-xr-x[-rw-r--r--]extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/Rhapsody2PapyrusSemanticElements.qvto25
1 files changed, 17 insertions, 8 deletions
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/Rhapsody2PapyrusSemanticElements.qvto b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/Rhapsody2PapyrusSemanticElements.qvto
index 24949da83ec..0ccf09b4dc7 100644..100755
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/Rhapsody2PapyrusSemanticElements.qvto
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/Rhapsody2PapyrusSemanticElements.qvto
@@ -30,6 +30,8 @@ transformation Rhapsody2PapyrusSemanticElements(in inModel:umlrhapsody, out outM
property events : Set(IEvent) = null;
+/**This variable is used to reference the types created outside of all contexts. (bug 510869)*/
+property userTypeDeclaration: Set(Type);
/**
* Maunch the semantic transformation
@@ -69,6 +71,13 @@ mapping umlrhapsody::IProject::iProjectToPapyrusModel() : uml::Model {
};
packageImport+=importedPackages;
+
+ if(userTypeDeclaration->notEmpty()){
+ packagedElement+= object Package{
+ name:="UserTypesDeclaration";
+ packagedElement+=userTypeDeclaration;
+ }
+ }
}
/**
@@ -205,19 +214,16 @@ mapping umlrhapsody::IClass::toUMLInterface() : uml::Interface when {self.oclIsT
/**
*
-* When we match any condition, we create a uml::Class.
-* If we are are, there is a bug!
+* When we match any condition, we create a uml::DataType.
+* We can be here in case of bug, when an existing type has not been resolved
+* or when the user use the C type declaration in Rhapsody (declaring a type with a string, see bug 510869)
*/
-mapping umlrhapsody::IType::iTypeToDefault():uml::Class{
+mapping umlrhapsody::IType::iTypeToDefault():uml::DataType{
if(self.name=null or self.name.oclIsInvalid()){
if(self.declaration<>null){
name:=self.declaration;
- log("We don't found the good type for an unamed element, with has this declaration: " + self.declaration);
- }else{
- log("We don't found the good type for an unamed element");
}
}else{
- log("We don't found the good type for " + self.name + " so we used the default type mapping for it");
name:=self.name.replaceAll("\"","");
};
}
@@ -1003,6 +1009,7 @@ mapping umlrhapsody::IArgument::iArgumentToUMLElement(): uml::Property when {sel
// should add the PtR Stereotpe if the type is a C++ Declaration : i,e: Class *;
if (self.typeOf.oclIsUndefined()){
type := self.myTypeOf [IType]->any(true).oclAsType(IType).map iTypeToUMLElement().oclAsType(Type);
+ userTypeDeclaration+=type;
}else{
type := self.typeOf [IType]->any(true).oclAsType(IType).map iTypeToUMLElement().oclAsType(Type);
};
@@ -1015,6 +1022,7 @@ mapping umlrhapsody::IAttribute::iAttributeToUMLElement(): uml::Property when {s
if (self.typeOf.oclIsUndefined()) {
type := self.myTypeOf [IType]->any(true).oclAsType(IType).map iTypeToUMLElement().oclAsType(Type);
+ userTypeDeclaration+=type;
}else{
type := self.typeOf [IType]->any(true).oclAsType(IType).map iTypeToUMLElement().oclAsType(Type);
};
@@ -1109,7 +1117,8 @@ mapping umlrhapsody::IArgument::toArguments(): uml::Parameter
// should add the PtR Stereotpe if the type is a C++ Declaration : i,e: Class *;
if (self.typeOf.oclIsUndefined())
{
- type := self.myTypeOf [IType]->any(true).oclAsType(IType).map iTypeToUMLElement().oclAsType(Type);
+ type := self.myTypeOf [IType]->any(true).oclAsType(IType).map iTypeToUMLElement().oclAsType(Type);
+ userTypeDeclaration+=type;
}else
{
type := self.typeOf [IType]->any(true).oclAsType(IType).map iTypeToUMLElement().oclAsType(Type);

Back to the top