I am trying to load a UML model stored as XMI via the eclipse MDT/UML2 implementation.
So far I have successfully loaded the model itself from a ResourceSet and I can walk through my model as expected. However, I have trouble loading our custom UML profile that is contained in the XMI file.
I have xmlns:MyProfile="..." and xsi:schemaLocation="... file:/path/to/profile.uml" attributes in the XMI file, as well as a profileApplication tag inside the uml:Model tag.
However, on the loaded model calls to getAppliedProfiles and getProfileApplications return an empty list. When using the debugging I can see that the model is not loading the profileApplication tag correctly.
I experimented with various ways to configure the UriMap of the ResourceSet, but so far haven’t managed to get anything working. When I open the corresponding XMI file within eclipse, everything is showing up fine and the profile is loaded well, so all paths are correct. What else am I missing?
You can not load profiles because the profile is related to a project property and can not be used outside as a standalone. You can load a model then take a profile and apply this profile as a project property. It would do the job.
Hope this help.