Get All Stereotype of Element ( getAppliedStereotypes ) [message #1007157] |
Mon, 04 February 2013 16:03 |
edipo federle Messages: 21 Registered: November 2012 |
Junior Member |
|
|
Hi, I am trying use method getAppliedStereotypes but that return empty list.
I Have a model.uml and a profile.uml. In the model I have a class called Test, with a stereotype called Interface applied to this class.
But in java when I try to retrieve the stereotypes I get an empty list
I try Add this to my ResourceSet:
RESOURCE_SET.getURIConverter().getURIMap().put(URI.createURI("pathmap://Papyrus_PROFILES/smartyProfile.uml"), URI.createFileURI(new File("/Users/edipofederle/Documents/smartyProfile.uml").getAbsolutePath()));
But dont work.
Does anyone know how to solve this problem?
Thanks
[Updated on: Mon, 04 February 2013 20:45] Report message to a moderator
|
|
|
|
|
Re: Get All Stereotype of Element ( getAppliedStereotypes ) [message #1007636 is a reply to message #1007188] |
Wed, 06 February 2013 20:15 |
edipo federle Messages: 21 Registered: November 2012 |
Junior Member |
|
|
Hello, good news, It worked! I will show below how I get that done.
First of all. You can use this POM.XML file ( if you already using maven ).
The first thing than you need is register path maps, like this:
https://gist.github.com/edipofederle/4725342
And when you load the model, you should use a code than looks like this:
https://gist.github.com/edipofederle/4725346
Notice the parameter pathAbsolute, this is necessary. In short, you need the uri absolute to the resource ( i.e: your model ). The first parameter, uri, is the relative uri to your resource.
About model:
In my work, I am reading the uml files exported from Papyrus. To this works, you need all files. When I say all files, I want say that, for example. If you have a model called model ( created on papyrus), and a profile called myProfile, when you export this model the follow files should be present:
- model.uml
- mode.notation
- model.di
The same to the profile:
- myProfile.uml
- myProfile.notation
- myProfile.di
This is all. If someone have problems, fell free to asking.
|
|
|
Powered by
FUDForum. Page generated in 0.02836 seconds