Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Default value "*" of tag with type UnlimitedNatural gets lost
Default value "*" of tag with type UnlimitedNatural gets lost [message #621680] Fri, 15 June 2007 12:45
Peter Ellsiepen is currently offline Peter EllsiepenFriend
Messages: 19
Registered: July 2009
Junior Member
I have a stereotype "string" which applies to uml:Datatype with an
optional tag "maxLength" (multiplicity 0..1) of type UnlimitedNatural.
The default value of the tag is set to "*" to represent the unlimited
case. In the profile (*.profile.xmi) this is represented as follows:

....
<packagedElement xmi:type="uml:Stereotype"
xmi:id="_14c603f2_1098865040591_924775_32" name="string">
<ownedAttribute xmi:type="uml:Property"
xmi:id="_14c603f2_1099404297833_151496_3595" name="maxLength"
visibility="public">
<type xmi:type="uml:PrimitiveType"
href=" http://schema.omg.org/spec/UML/2.1.1/uml.xml#UnlimitedNatura l"/>
<upperValue xmi:type="uml:LiteralInteger"
xmi:id="_10_0_17260432_1129543822706_974393_80" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_10_0_17260432_1129543822706_528510_79"/>
<defaultValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_12_1_17260432_1181825212478_838715_611" value="*"/>
</ownedAttribute>
<ownedAttribute xmi:type="uml:Property"
xmi:id="_12_0_17260432_1170851834566_888187_3833" name="base_DataType"
visibility="private" association="_12_0_17260432_1170851834566_168458_3831">
<type xmi:type="uml:Class"
href="http://schema.omg.org/spec/UML/2.1.1/uml.xml#DataType"/>
</ownedAttribute>
</packagedElement>
....

Further, I have a model which applies this stereotype to a uml:DataType
but does not assign any value to the tag. In the model (*.xmi) the
stereotype application looks like this:

<Information_Viewpoint:string
xmi:id="_12_1_f810373_1178606771464_260949_405"

base_DataType="_12_1_f810373_1178606771464_122535_404"/>

From the UML 2.x semantics I would now expect that the tag "maxLength"
is assigned its default value from the stereotype definition (i.e. "*",
or -1 via LiteralUnlimitedNatural.UNLIMITED). However, when reading the
tag value via API using the convenience function

element.getValue(stereotype, "maxLength")

I always get 0, which is the default for the UnlimitedNatural type, but
not the default I assigned via my stereotype! The same happens when
loading the model into the UML2 editor, where the default value of the
stereotype tag is correctly shown as "*", but the tag value of the
stereotype application is 0.

So the issue seems to be that the default assigned by the stereotype
somehow gets lost when reading the file. Any ideas what the reason could be?

Regards, Peter

PS: I am using EMF 2.2.0 and UML2 2.0.3 with Eclipse 2.2.2. If needed, I
can send through the example via email.
Previous Topic:basic question: how to load a uml model?
Next Topic:Default value "*" of tag with type UnlimitedNatural gets lost
Goto Forum:
  


Current Time: Thu Apr 25 09:11:46 GMT 2024

Powered by FUDForum. Page generated in 0.03471 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top