Zero values in literals omitted in .UML file [message #1773294] |
Tue, 26 September 2017 08:45 |
Benedikt Bauer Messages: 24 Registered: March 2017 |
Junior Member |
|
|
A colleague of mine recently came across some unexpecetd behaviour in the .uml file that Papyrus uses to save a SyML model: If the value of a literal in an an instance slot is zero, the "value" tag in the .uml file is omitted. It looks like papyrus is assuming implicitly that a missing value tag equals a value of "0".
I was wondering whether this is a convention in the XMI standard or something Papyrus does on its own for some reason. If the latter, is it a bug or is it intended?
Steps to reproduce
- Create a SysML model
- Add an instance specification and an instance slot therein
- Create literals of of different types (integer, real, bool...) in the instance slot. Create some with value "0" and some with a non-zero value
- Save the model
- Open the .uml file of the model with a text editor and search for the definition of the created literals (Compare code below).
- Only literals of nonzero value contain a value="..." tag.
<slot xmi:type="uml:Slot" xmi:id="_stN8QJnuEeeFToQU8dZboQ" definingFeature="_2Xe3kJntEeenh9hS7_Hu7Q">
<value xmi:type="uml:LiteralReal" xmi:id="_KLexEJnvEeeFToQU8dZboQ" name="real"/>
<value xmi:type="uml:LiteralInteger" xmi:id="_qykYAJnvEeeFToQU8dZboQ" name="int"/>
<value xmi:type="uml:LiteralBoolean" xmi:id="_LMRqQJnwEeeFToQU8dZboQ" name="bool_false"/>
<value xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Ri9fgJnwEeeFToQU8dZboQ" name="LiteralUnlimitedNatural"/>
<value xmi:type="uml:LiteralBoolean" xmi:id="_wys94KKUEeejL5UD3kFAsw" name="bool_true" value="true"/>
<value xmi:type="uml:LiteralInteger" xmi:id="_zjBJYKKUEeejL5UD3kFAsw" name="int_nonzero" value="11"/>
<value xmi:type="uml:LiteralReal" xmi:id="_4opmcKKUEeejL5UD3kFAsw" name="real_nonzero" value="0.1"/>
<value xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_7on-kKKUEeejL5UD3kFAsw" name="LiteralUnlimitedNatural_nonzero" value="12"/>
</slot>
I din't check for a UML model but I would expect the same outcome.
[Updated on: Tue, 26 September 2017 08:56] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01449 seconds