I have a UML model based on UML2 version 2.0.0 (xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML")
. In eclipse I have latest version on Papyrus installed, which comes with UML2 version 2.5.0.
The model I have is a very simple model generated from Rhapsody, in which I have one Requirement
(requirement_1), one Block
and one Operation
(test_req()) in Block. In the model, test_req() operation verifies the requirement_1 as shown in diagram below:
Using Rhapsody XMI toolkit, I am exporting the model to XMI format and trying to import it to eclipse as Papyrus Project. When I import model into Papyrus Project, the Stereotype(verify) applied on dependency between test_req() and requirement_1 is not detected:
As it can be seen in image, <<verify>>
stereotype in not applied to requirement_1
.
Can anyone explain why the stereotype is missing? Is it because of difference in versions of UML2? How can I fix this?
I am also posting my UML model for reference here
The main problem here is that the Model I have is based on UML2 version 2.0.0 and in eclipse, I have the latest version of UML installed i.e. UML 2.5.0. So when I try to import my model into Papyrus project it uses UML2 version 2.5.0 and not 2.0.0 and so some stereotypes are not recognized.
I am able to fix my code which finds the existing relationships in model by adding following code to make sure UML2 version 2.0.0 is used:
ResourceSet set = new ResourceSetImpl();
UMLResourcesUtil.init(set);
set.getResourceFactoryRegistry().getExtensionToFactoryMap()
.put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
set.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
Map<URI, URI> uriMap = set.getURIConverter().getURIMap();
URI uri = URI.createURI("jar:file:/home/jars/org.eclipse.uml2.uml.resources_2.0.3.v200707131442.jar!/"); // for example
uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri.appendSegment("metamodels").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri.appendSegment("profiles").appendSegment(""));