Author Topic: [Bugs] XMI-Exporter Bugs (Collection Thread)  (Read 7907 times)

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
[Bugs] XMI-Exporter Bugs (Collection Thread)
« on: September 26, 2007, 02:26:50 am »
Hi,
our team want to use Enterprise Architect for creating models and exporting it to XMI 2.1. By exporting a lot of different little models, we found some bugs, like missing informations.
XMI is very important, so I think its a good idea to create this thread to collect all bugs of the XMI-Exporter.

So, let us begin :-)

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #1 on: September 26, 2007, 02:28:41 am »
XMI-Version:
2.1
EA-Build:
817
Problem:
After exporing a class, component or message (sequence diagram), no informations about the basic-types (double, String, ...) are stored. The only way to get this information is to look in the extensions section. That's not very elegant. Attributes, whose type is specified with a class, will be stored (with <type xmi:idref="ID"/>).
Reproduction/Picture:

XMI-Code:
Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<xmi:XMI xmi:version="2.1" xmlns:uml="http://schema.omg.org/spec/UML/2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1">
 <xmi:Documentation exporter="Enterprise Architect" exporterVersion="6.5"/>
 <uml:Model xmi:type="uml:Model" name="EA_Model" visibility="public">
   <packagedElement xmi:type="uml:Package" xmi:id="0E386949_8A20" name="Model" visibility="public">
<packagedElement xmi:type="uml:Package" xmi:id="9E7BD7F4_027C" name="Class Model" visibility="public">
  <packagedElement xmi:type="uml:Class" xmi:id="179A3583_6AE1" name="$help://classdiagram.htm" visibility="public"/>
  <packagedElement xmi:type="uml:Class" xmi:id="29A94BBC_1192_" name="$help://class_model_pattern.htm" visibility="public"/>
  <packagedElement xmi:type="uml:Package" xmi:id="B3FA55F1_7650" name="System" visibility="public">
    <packagedElement xmi:type="uml:Class" xmi:id="15CBBC74_D2FD" name="Class1" visibility="public">
 <ownedAttribute xmi:type="uml:Property" xmi:id="E7064343_2190" name="aBooleanVariable" visibility="private"  
  isDerived="false">
   <lowerValue xmi:type="uml:LiteralInteger" xmi:id="LI000001_2190" value="1"/>
   <upperValue xmi:type="uml:LiteralInteger" xmi:id="LI000002_2190" value="1"/>
 </ownedAttribute>
 <ownedAttribute xmi:type="uml:Property" xmi:id="4F116335_17B5" name="aDoubleVariable" visibility="private"  
  isDerived="false">
   <lowerValue xmi:type="uml:LiteralInteger" xmi:id="LI000003_17B5" value="1"/>
   <upperValue xmi:type="uml:LiteralInteger" xmi:id="LI000004_17B5" value="1"/>
 </ownedAttribute>
 <ownedOperation xmi:id="43BDD403_3700" name="operation1" visibility="public" concurrency="sequential">
   <ownedParameter xmi:id="B948AAF9_124B" name="x" direction="in"/>
   <ownedParameter xmi:id="7E68882C_4CAA" name="y" direction="in"/>
 </ownedOperation>
    </packagedElement>
  </packagedElement>
</packagedElement>
   </packagedElement>
 </uml:Model>
 <xmi:Extension extender="Enterprise Architect" extenderID="6.5">
   [deleted]
 </xmi:Extension>
</xmi:XMI>

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #2 on: September 26, 2007, 02:31:00 am »
XMI-Version:
2.1
EA-Build:
817
Problem:
The message of a sequence diagram doesn't store the parameter values. The values can only be found in the extensions :-(
Reproduction/Picture:
Create a class with an operation (with parameters) and a sequence diagram with two objects of this class. Then insert a message (the operation with parameter), fill in the variables and export it to XMI.
XMI-Code:
A message 'initCan(8000, false)':
Code: [Select]
<fragment xmi:type="uml:OccurrenceSpecification" xmi:id="FR000001_0E70" covered="25275F16_0E70"/>
<fragment xmi:type="uml:OccurrenceSpecification" xmi:id="FR000001_B0F5" covered="LL000000_B0F5"/>
<message xmi:type="uml:Message" xmi:id="A2A1EF7F_FFBF" name="initCAN(int, boolean)" messageKind="complete" messageSort="synchCall" sendEvent="FR000001_0E70" receiveEvent="FR000001_B0F5" signature="229D73DC_2857">
   <argument xmi:type="uml:LiteralString" xmi:id="AR000009_FFBF" name="baudrate"/>
   <argument xmi:type="uml:LiteralString" xmi:id="AR000022_FFBF" name=" startOnInit"/>
</message>

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #3 on: September 26, 2007, 02:31:50 am »
[size=18]FIXED in Build 818!![/size]

XMI-Version:
2.1
EA-Build:
817
Problem:
Unlinke the continuation, a state invariant doesn't store the information about the covered lifeline (even though it's snaped on it).
Reproduction/Picture:
Create a lifeline with a state invariant and a continuation on it. Export it to XMI 2.1 ;-)
XMI-Code:
Code: [Select]
<fragment xmi:type="uml:StateInvariant" xmi:id=" 1D006C13_191D">  
   <invariant xmi:type="uml:Constraint" xmi:id="CO000000_191D" visibility="public">
       <specification xmi:type="uml:OpaqueExpression" xmi:id="OE000000_191D" body="X==10"/>
   </invariant>
</fragment>

<fragment xmi:type="uml:Continuation" xmi:id="B0A3CE86_9DC4" name="X==10" setting="false">
   <covered xmi:idref="501395CF_5BEC"/>
</fragment>
« Last Edit: November 21, 2007, 07:32:00 am by MrDX »

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #4 on: September 26, 2007, 02:32:28 am »
XMI-Version:
2.1
EA-Build:
817
Problem:
A state invariant in a sequence diagramm will be stored at the wrong position of the sequence diagram, instead of the correct order.
Reproduction/Picture:

XMI-Code:
Code: [Select]
<packagedElement xmi:type="uml:Package" xmi:id="EAPK_92057C57" name="Dynamic View" visibility="public">
   <packagedElement xmi:type="uml:Collaboration" xmi:id="CB000000_C57" name="EA_Collaboration1" visibility="public">
       <ownedBehavior xmi:type="uml:Interaction" xmi:id="IN000000_C57" name="EA_Interaction1" visibility="public">
           <lifeline xmi:type="uml:Lifeline" xmi:id="LL000000_E2B7" name="a" visibility="public" represents="AT000000_000"/>
           <lifeline xmi:type="uml:Lifeline" xmi:id="LL000000_7679_4b79_A3A4_C899CA8B99CE" name="b" visibility="public" represents="AT000000_000"/>
           <fragment xmi:type="uml:OccurrenceSpecification" xmi:id="FR000000_E2B7" covered="LL000000_E2B7"/>
           <fragment xmi:type="uml:OccurrenceSpecification" xmi:id="FR000000_7679" covered="5959F91D_7679"/>
           <fragment xmi:type="uml:StateInvariant" xmi:id="C2C0F1ED_480C">
               <invariant xmi:type="uml:Constraint" xmi:id="CO000000_480C" visibility="public">
                   <specification xmi:type="uml:OpaqueExpression" xmi:id="OE000000_480C" body="X==0"/>
               </invariant>
           </fragment>
           <fragment xmi:type="uml:OccurrenceSpecification" xmi:id="FR000002_E2B7" covered="LL000000_E2B7"/>
           <fragment xmi:type="uml:OccurrenceSpecification" xmi:id="FR000002_7679" covered="5959F91D_7679"/>
           <fragment xmi:type="uml:OccurrenceSpecification" xmi:id="FR000001_E2B7" covered="LL000000_E2B7"/>
           <fragment xmi:type="uml:OccurrenceSpecification" xmi:id="FR000001_7679" covered="5959F91D_7679"/>
           <fragment xmi:type="uml:StateInvariant" xmi:id="284B04C7_B098">
               <invariant xmi:type="uml:Constraint" xmi:id="CO000000_B098_40b3" visibility="public">
                   <specification xmi:type="uml:OpaqueExpression" xmi:id="OE000000_B098" body="Z==Y"/>
               </invariant>
           </fragment>
           <message xmi:type="uml:Message" xmi:id="1F10E63E_E8B5" name="doNothing()" messageKind="complete" messageSort="synchCall" sendEvent="FR000000_E2B7" receiveEvent="FR000000_7679" signature="0462CF75_F8E6"/>
           <message xmi:type="uml:Message" xmi:id="937C773E_06BF" name="doSomething()" messageKind="complete" messageSort="synchCall" sendEvent="FR000002_E2B7" receiveEvent="FR000002_7679" signature="A9527BF9_09D0"/>
           <message xmi:type="uml:Message" xmi:id="5C33CFEC_4D71" name="goToBed()" messageKind="complete" messageSort="synchCall" sendEvent="FR000001_E2B7" receiveEvent="FR000001_7679" signature="A038909D_C66F"/>
       </ownedBehavior>
       <ownedAttribute xmi:type="uml:Property" xmi:id="AT000000_000">
           <type xmi:idref="5538E2C3_E2B7"/>
       </ownedAttribute>
       <ownedAttribute xmi:type="uml:Property" xmi:id="AT000000_000">
           <type xmi:idref="5959F91D_7679"/>
       </ownedAttribute>
   </packagedElement>
   <packagedElement xmi:type="uml:Class" xmi:id="F0CAB999_4FB5" name="TestClass" visibility="public">
       <ownedOperation xmi:id="0462CF75_F8E6" name="doNothing" visibility="public" concurrency="sequential"/>
       <ownedOperation xmi:id="A9527BF9_09D0" name="doSomething" visibility="public" concurrency="sequential"/>
       <ownedOperation xmi:id="A038909D_C66F" name="goToBed" visibility="public" concurrency="sequential"/>
   </packagedElement>
   <packagedElement xmi:type="uml:InstanceSpecification" xmi:id="5538E2C3_E2B7" name="a" visibility="public" classifier="F0CAB999_4FB5"/>
   <packagedElement xmi:type="uml:InstanceSpecification" xmi:id="5959F91D_7679" name="b" visibility="public" classifier="F0CAB999_4FB5"/>
</packagedElement>

=> Instead of 'Msg-StateInvariant-Msg-StateInvariant-Msg', the exporter generates 'Msg-StateInvariant-Msg-Msg-StateInvariant'
« Last Edit: September 26, 2007, 02:34:03 am by MrDX »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #5 on: September 26, 2007, 02:49:48 am »
So, over to Sparx now.

Waiting...
No, you can't have it!

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #6 on: October 08, 2007, 05:23:04 am »
XMI-Version:
2.1
EA-Build:
817
Problem:
Instead of saving enumeration liteals als uml:EnumeraionLiteral, uml:Property is used (like normal attributes).
Reproduction/Picture:
Create a enumeration and export it to XMI 2.1, for example:
enum TestEnum{e1=0x01,e2=0x02}
XMI-Code:
Code: [Select]
<packagedElement xmi:type="uml:Enumeration" xmi:id="D84E4C70_960E" name="TestEnum" visibility="public">
   <ownedAttribute xmi:type="uml:Property" xmi:id="BC8D3340_193C" name="e1" visibility="public" isDerived="false">
       <lowerValue xmi:type="uml:LiteralInteger" xmi:id="LI000005_193C" value="1"/>
       <upperValue xmi:type="uml:LiteralInteger" xmi:id="LI000006_193C" value="1"/>
       <defaultValue xmi:id="LI000007_193C" value="0x01"/>
   </ownedAttribute>
   <ownedAttribute xmi:type="uml:Property" xmi:id="80D5B9F6_B0D3" name="e2" visibility="public" isDerived="false">
       <lowerValue xmi:type="uml:LiteralInteger" xmi:id="LI000007_B0D3" value="1"/>
       <upperValue xmi:type="uml:LiteralInteger" xmi:id="LI000008_B0D3" value="1"/>
       <defaultValue xmi:id="LI000009_B0D3" value="0x02"/>
   </ownedAttribute>
</packagedElement>

I think, that should be something like this (0x01 and 0x02 are missing)
Code: [Select]
<packagedElement xmi:type="uml:Enumeration" xmi:id="D84E4C70_960E" name="TestEnum" visibility="public">
   <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="BC8D3340_193C" name="e1" visibility="public"/>
   <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="BC8E3340_193C" name="e2" visibility="public"/>
</packagedElement>
« Last Edit: October 08, 2007, 05:24:44 am by MrDX »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #7 on: October 08, 2007, 12:32:57 pm »
I'm not sure this is really a defect, rather than just a stylistic preference. There's a lot of 'baggage' relating to using attributes versus elements in XML schema and XMI (and other dialects as well). There are significant advantages either way, as well as definite limitations.

The good news is that the workarounds are fairly straightforward (if not always necessarily quick or simple).

IMHO (with considerable stress on the H) it would be best to get the defects resolved immediately. Afterwards it might be worth looking into changing the output style. Given that a major stylistic change would break current implementations this could be quite jarring.

--- New suggestion ---

Perhaps we would work with Sparx to come up with some kind of survey on whether this could (or even should) be done, and the best way to mitigate any resultant issues. We might even come up with a means to support a 'new' style, while leaving the current implementation as an optional 'old' format.

The above process might be something we (the user community and Sparx) could reuse for other changes. This might be worth pursuing on its own.

What say all?

David
No, you can't have it!

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #8 on: October 13, 2007, 10:07:15 am »
I tried to load the generated XMI files with the Eclipse Modeling Framework (with the UML2 project). EMF/UML2 says, that the attributes within the Enumeration aren't legal. After changing it to EnumerationLiterals, EMF/UML2 accepted the Enumeration and loaded it.

By loading it with EMF, i found some more bugs:
- The attribute 'interactionOperator' in uml:CombinedFragment shouldn't have the prefix 'intop_'. FIXED in Build 818!!

- The attribute 'direction' in 'uml:Parameter' souldn't have the prefix 'pk_' FIXED in Build 818!!

- The attribute 'covered' references sometimes to uml:InstanceSpecification, instead of uml:Lifeline (some are referenced correctly, some of them are incorrect)

- It seems, that messages aren't stored correctly in XMI. There is a uml:Message that needs two uml:MessageEnds for 'sendEvent' and 'receiveEvent'. The XMI exporter generates uml:OccurenceSpecifications, but the UML-Metamodell says, that OccurenceSpecification isn't a uml:MessageEnds. I think, the right element is uml:MessageOccurrenceSpec (with superclass uml:MessageEnd and uml:OccurenceSpecification).

- Sometimes, there are no arguments stored in a uml:message.  and I don't know how to reproduce this situation (situation with exported arguments and without exported arguments).

If it's important to improve the XMI exporter, I can post the error message(s) of EMF.
« Last Edit: November 21, 2007, 07:33:15 am by MrDX »

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #9 on: October 15, 2007, 03:39:42 am »
It seems, that I am the only one who needs the XMI-Exporter ^^

I wrote a bug report to Sparx some days ago, but nobody is answering :(

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: [Bugs] XMI-Exporter Bugs (Collection Thread)
« Reply #10 on: October 17, 2007, 03:28:09 am »
And a new bug :-)

The exporter doesn't store timing informations for messages correctly.
A message with all four kinds of constraints (duration observation/constraint, time observation/constraint) in XMI, which is exported by Enterprise Architect looks like this (the two generated rules):
Code: [Select]
<ownedRule xmi:type="uml:TimeConstraint" xmi:id="TC000000_6A09" visibility="public">
   <constrainedElement xmi:idref="D3863816_6A09"/>
   <specification xmi:type="uml:TimeExpression" xmi:id="TS000000_6A09" visibility="public">
       <expr xmi:type="uml:OpaqueExpression" xmi:id="TE000000_6A09" body="t..t+3"/>
       <observation xmi:type="uml:TimeObservation" xmi:id="TO000000_6A09" name="@t" event="D3863816_6A09"/>
   </specification>
</ownedRule>
<ownedRule xmi:type="uml:DurationConstraint" xmi:id="TC000000_6A09" visibility="public">
   <constrainedElement xmi:idref="D3863816_6A09"/>
   <specification xmi:type="uml:Duration" xmi:id="TS000000_6A09" visibility="public">
       <expr xmi:type="uml:OpaqueExpression" xmi:id="TE000000_6A09" body="0..13"/>
       <observation xmi:type="uml:DurationObservation" xmi:id="TO000000_6A09" name="d..3*d" event="D3863816_6A09"/>
   </specification>
</ownedRule>

The generated code looks very nice, but the metamodel does not allow that :-( So, I can't import it with EMF. The error message:
Quote
Value org.eclipse.uml2.uml.internal.impl.TimeExpressionImpl is not legal


I have taken a look at the 'Simple Time'-Diagram of the UML superstructure specification:
http://img206.imageshack.us/img206/5200/simpletimegj5.png
I think, the 'specification'-tag is not allowed, because a TimeConstraint and DurationConstraint only accept a TimeInterval or DurationInterval as 'specification'.

It would be nice, if this little bug would be fixed or someone can tell me what the correct xmi representation is :-)