Hey Paolo,
I've run a few very simple tests on 15.1.1528. I hope they can be of some use to you, or to Sparx when and if they get to fixing this.
Setup: Root
View
«profile» MyProfile {Package; version 1.0}
MyProfile {Class diagram; version 1.0}
«metaclass» Class
«stereotype» MyStereotype
FlagTag: Boolean
MyStereotype has an Extension to Class, and the diagram contains both elements and the connector.
There are nothing in any Notes fields, and there are no shape scripts or appearances set. Straight from the box.
Publication method differencesIf you publish this profile from the GUI, you get the following:
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">
<Documentation id="1CA78D9B-7" name="MyProfile" version="" notes="MyProfile"/> <-- Diagram version
<Documentation id="6453A0AE-1" name="MyProfile" version="1.0" notes="MyProfile"/> <-- Package version
<Content>
<Stereotypes>
<Stereotype name="MyStereotype" notes="" cx="96" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0"> <-- Diagram version
<Stereotype name="MyStereotype" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0"> <-- Package version
<AppliesTo>
<Apply type="Class">
<Property name="isActive" value=""/>
</Apply>
</AppliesTo>
<TaggedValues>
<Tag name="FlagTag" type="Boolean" description="" unit="" values="True,False" default=""/>
</TaggedValues>
</Stereotype>
</Stereotypes>
<TaggedValueTypes/>
<ViewDefinitions/>
<Metamodel/>
</Content>
</UMLProfile>
The
id attributes in the
<Documentation> elements are taken from the GUIDs of the diagram/package, so they won't be the same if you recreate this. But the other differences are things that EA decides to do differently. When publishing from the diagram, EA does not pick up the diagram version and suggest it in the Save UML Profile dialog (although you can of course enter one yourself), and when publishing from the package, it sets
cx and
cy to 0.
Element locationIf you publish from the diagram, element location doesn't matter. The result is the same whether the metaclass and stereotype are both in, both out, or one in and one out, of the package where the diagram resides.
If you publish from the package, things are different.
- If just the metaclass is in a different package, the result is the same as if everything is in the profile package.
- If just the stereotype is in a different package, the result is an empty <Stereotypes/> element.
- If both the metaclass and the stereotype are in a different package, the profile publication fails with the error
Syntax error (missing operator) in query expression 'Start_Object_ID in () or End_Object_ID in ()'.
Stereotype appearance (F4)If you change the stereotype's appearance to something rather hideous, you get the following change in the published profile:
<Stereotype name="MyStereotype" notes="" cx="96" cy="70" bgcolor="16748574" fontcolor="65535" bordercolor="2263842" borderwidth="2" hideicon="0"> <-- Diagram version
<Stereotype name="MyStereotype" notes="" cx="0" cy="0" bgcolor="16748574" fontcolor="65535" bordercolor="2263842" borderwidth="2" hideicon="0"> <-- Package version
If you then reset the stereotype's appearance, it doesn't reset properly in the diagram: the border width is still thick, even though the Default Appearance dialog reports it as 1 (which is the default) and shows it as thin in its preview.
Generating from this now somewhat broken model yields:
<Stereotype name="MyStereotype" notes="" cx="96" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="2" hideicon="0"> <-- Diagram version
<Stereotype name="MyStereotype" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="1" hideicon="0"> <-- Package version
Note the difference in
borderwidth.
So the presentation of the stereotype element in the diagram has not been properly reset. The diagram version of the profile has the old border width (which is still shown in the diagram), while the package version has a border width of 1, which is what the Default Appearance dialog claims it is, but which is not what gets published for a stereotype that has the actual default border width (defaults are -1).
The Default Appearance does not allow you to change the border width to -1, and changing it to anything else has no effect: whether that's because it only allows a single change ever, or whether it gets stuck after resetting to defaults I can't say.
/Uffe