|
Re: Stereotypes Lost [message #999355 is a reply to message #999273] |
Fri, 11 January 2013 22:26 |
|
Hi,
I'm not sure that I fully understand your situation.
If the schema URI reference to the profile is relative, then it is
resolved based on the URI of the referencing resource (your model
resource). So, if you move the model resource, then the profile
resource must be moved accordingly so that it is in the same place
*relative to* the model resource. That's how relative paths work on
the web, in file systems, etc.
The absolute URI reference works if you *do not* move the profile
resource, no matter where the model resource is located. But, it's not
portable. Only somebody who has it in that exact directory on a
Windows PC will be able to resolve the profile and use the model. It
is definitely preferred to have either a relative URI or an abstract
URI such as platform:/resource or platform:/plugin scheme, or even
better a registered http: or pathmap: URI.
But, you started by saying that you lost stereotypes when you moved a
package (I assume having the profile applied) in the Model Explorer.
Do you mean that you moved it into another parent package? In the same
model? If it inherited the profile application from a containing
package and the package into which you moved it doesn't have that
profile applied, then it is expected that stereotypes from the profile
will be unapplied because they are no longer applicable.
Otherwise, if the problem was just that the model resource was moved on
the filesystem (in the Project explorer), then the reason why
stereotype applications seem to disappear is that their schema is not
resolved, so EMF could not load them.
HTH,
Christian
On 2013-01-11 17:49:05 +0000, E. TOSI said:
> I don't know why, but in my UML model, the Profile was tagged as Re-apply.
> I do It, seems to be OK.
>
> But if I move a new created Package in model explorer tree, most (not
> all !) of my stereotypes are lost 8o
> After exploring my TFS history I have notice a strange detail in Xmi File :
>
> If your profile location is relative : xsi:schemaLocation="Myprofile
> ../Profiles/MyProfile.uml#_rpobQEXSEeKE79IdqNrADA"> it is OK !
>
> The bug was raised when the profile Location is like this :
> file:/O:/temp/Profiles/MyProfile.uml#_rpobQEXSEeKE79IdqNrADA">
>
> I don't know why, but it seems to be a bug...
> [Using Eclipse Juno 20120620-1657 & Papyrus 0.9.v201206131215
|
|
|
|
Re: Stereotypes Lost [message #1000590 is a reply to message #1000316] |
Tue, 15 January 2013 04:04 |
|
Sorry, I can't guess why something might be changing the URIs of your
resources. You might debug the code to see where the resource's URI is
changed, and backtrack to see why.
If the profile (applied to the root package) isn't resolved (i.e., it's
a proxy), then the UML API won't be able to determine what stereotypes
it makes available. So, when you move a package (or any element), as
it is detached and re-attached to the model, the UML API internally
will re-calculate the applicable stereotypes. Because the profile
isn't resolved, it will find that there are no applicable stereotypes,
so any that you had applied before will be unapplied ("lost").
So, you really need to find out why the profile is becoming unapplied.
Without further information or a reproducible test case, I can't
suggest why.
HTH,
Christian
On 2013-01-14 14:07:05 +0000, E. TOSI said:
> Hi Christian,
>
> Thanks for your response.
>
> We didn't touch the profile Location. Something not identified happened
> and change It to "file:"
> All files are on same locations and could be resolved even by "file:/"
> or by RelativePath of the project.
>
> Profile is applied on the root package of the project. And loosing
> stereoptypes occured when moving at lower level subpackage in the tree.
> So stereotype still can be found because declared at root level.
>
> Is anobody can tell me what process is able to modify the schema URI
> reference to the profile ?
> I didn't find any option in Eclipse Juno.
>
> Txs,
|
|
|
Powered by
FUDForum. Page generated in 0.04168 seconds