Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2017-02-03 15:52:51 +0000
committervincent lorenzo2017-02-03 16:30:52 +0000
commit39467b3f6982ab57df83c06436d6ebf0a1d2db93 (patch)
treea13c79bbc144be6ca3352d450df8448437d5668b /extraplugins
parenta7347a4e189a153d4c53a384b0844de5624881f0 (diff)
downloadorg.eclipse.papyrus-39467b3f6982ab57df83c06436d6ebf0a1d2db93.tar.gz
org.eclipse.papyrus-39467b3f6982ab57df83c06436d6ebf0a1d2db93.tar.xz
org.eclipse.papyrus-39467b3f6982ab57df83c06436d6ebf0a1d2db93.zip
Bug 511654: [Importer][Rhapsody]The properties isConjugated are not well managed for UML and SysML by the Import Tool
Change-Id: Iccece9b48277bb66eaeb61a4a8d344d1cbc5fe84 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'extraplugins')
-rwxr-xr-xextraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/Rhapsody2PapyrusSemanticElements.qvto5
-rw-r--r--extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11Profile.qvto30
2 files changed, 33 insertions, 2 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 4a9ceb35f4f..faa65c3fd65 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
@@ -883,7 +883,10 @@ mapping umlrhapsody::IRelation::iRelationToSysMLPort(): uml::Port when {self.isR
type := sysPort.otherClass.oclAsType(EObject).map generalMappingToUMLElement().oclAsType(Type);
};
aggregation:=AggregationKind::composite;
- isConjugated:=sysPort.isConjugated();
+
+ //to my mind, the Rhapsody field isConjugated manage the SysML FlowPort property and the UML one.
+ //isConjugated:=sysPort.isConjugated();
+
//a multiplicity has been defined
if(not sysPort.multiplicity.oclIsUndefined()){
lowerValue:= createLowerMultiplicity(sysPort.multiplicity);
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11Profile.qvto b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11Profile.qvto
index 4817504bceb..ca9b6581103 100644
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11Profile.qvto
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/transform/SysML11Profile.qvto
@@ -283,13 +283,41 @@ mapping uml::Port::applySysML11FlowPort(rpyElement:EObject, stereotypeName:Strin
var stereotypeApplication:sysml11::portandflows::FlowPort:= object sysml11::portandflows::FlowPort{
base_Port:=self;
direction:=getSysML11FlowDirection(rpyElement.oclAsType(ISysMLPort).direction);
- isConjugated:=rpyElement.oclAsType(ISysMLPort).isConjugated();
+
+ if(not self.isAtomic(rpyElement.oclAsType(umlrhapsody::ISysMLPort))){
+ //If the FlowPort is atomic (by its type), then isAtomic=True, the direction must be specified (has a value), and
+ //isConjugated is not specified (has no value).
+ isConjugated:=rpyElement.oclAsType(ISysMLPort).isConjugated();
+ }else{
+ isConjugated:=false;
+ };
};
result:=stereotypeApplication.oclAsType(EObject);
}
}
/**
+* @param a ISysMLPort
+*
+* @return true if the port is atomic and false otherwise
+*
+*/
+helper uml::Port::isAtomic(rpyPort:umlrhapsody::ISysMLPort): Boolean{
+ var isAtomic:Boolean:=true;
+ if(self.type<>null){
+ //1. we need to call the mapping for stereotype applied on the type of the port to know if it is stereotyped with FlowSpecification
+ rpyPort.oclAsType(ISysMLPort).otherClass.oclAsType(EObject).map applyRequiredSysML11Stereotype();
+
+ //2. now we could check the stereotype applied on the type of the port
+ var flowSpec:uml::Stereotype:=self.type.getAppliedStereotype(getSysML11Stereotype("FlowSpecification").getQualifiedName());
+ if (flowSpec<> null) {
+ isAtomic:=false;
+ };
+ };
+ return isAtomic;
+}
+
+/**
*
* This method apply the stereotype SysML FlowPort
*/

Back to the top