Book a Demo

Author Topic: Xmi import : pb with constraints on associations  (Read 3704 times)

SebastienRoy

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Xmi import : pb with constraints on associations
« on: July 02, 2004, 07:40:29 am »
Hello,

I have trouble for importing a model from a xmi file (home generated) : all is imported fine in EA exepted for the constraints on associations. The constraints on classes, attributes and even associations ends are well imported but the ones on associations are not.
However, when I re-import an Xmi file exported by EA, the import goes well, with all the associations constraints.
Even though the constraint element format is exactely the same (I have checked it hundred times).
Does anybody know why this strange behaviour occures and how to import my constraints ?

Thanks a lot

Sebastien
« Last Edit: July 02, 2004, 07:52:26 am by SebastienRoy »

Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: Xmi import : pb with constraints on associatio
« Reply #1 on: July 05, 2004, 01:33:33 am »
Have you checked the versions of EA you're running? It might be that you're running an older version of EA at home that lacked the support of constraints for associations in XMI (check version history of EA).

SebastienRoy

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Xmi import : pb with constraints on associatio
« Reply #2 on: July 05, 2004, 02:04:56 am »
The version I am running is 4.1, build 730.
Here follows a sample of the xmi I try to import :

Code: [Select]


<?xml version="1.0"?>
<XMI xmi.version="1.1" xmlns:UML="omg.org/UML1.3">
     <XMI.header>
           <XMI.header>
                 <XMI.metamodel name="UML" version="1.3" href="UML.xml"/>
                 <XMI.model name="example" version="1" href="example.xml"/>
           </XMI.header>
     </XMI.header>
     <XMI.content>
           <UML:Model name="EA Model" xmi.id="MX_EAID_F0F1B9A0_3F79_4a82_8D1A_205E33BCB323">
                 <UML:Namespace.ownedElement>
                       <UML:Class name="EARootClass" isLeaf="false" xmi.id="EAID_11111111_5487_4080_A7F4_41526CB0AA00" isRoot="true" isAbstract="false"/>
                       <UML:Package name="AssocConstraintTest" visibility="public" isLeaf="false" isRoot="true" isAbstract="false" namespace="idD387F10">
                             <UML:ModelElement.taggedValue>
                                   <UML:TaggedValue tag="created" value="2004-06-14 00:00:00"/>
                                   <UML:TaggedValue tag="modified" value="2004-06-14 00:00:00"/>
                                   <UML:TaggedValue tag="iscontrolled" value="FALSE"/>
                                   <UML:TaggedValue tag="version" value="1.0"/>
                                   <UML:TaggedValue tag="isprotected" value="FALSE"/>
                                   <UML:TaggedValue tag="usedtd" value="FALSE"/>
                                   <UML:TaggedValue tag="logxml" value="FALSE"/>
                                   <UML:TaggedValue tag="phase" value="1.0"/>
                                   <UML:TaggedValue tag="status" value="Proposed"/>
                                   <UML:TaggedValue tag="complexity" value="1"/>
                                   <UML:TaggedValue tag="ea_stype" value="Public"/>
                             </UML:ModelElement.taggedValue>
                             <UML:Namespace.ownedElement>
                                   <UML:Class name="Class1" visibility="public" isLeaf="false" xmi.id="idD35DCA0" isRoot="false" isAbstract="false" namespace="idD387F10" isActive="false">
                                         <UML:ModelElement.taggedValue>
                                               <UML:TaggedValue tag="isSpecification" value="false"/>
                                               <UML:TaggedValue tag="ea_stype" value="Class"/>
                                               <UML:TaggedValue tag="ea_ntype" value="0"/>
                                               <UML:TaggedValue tag="version" value="1.0"/>
                                               <UML:TaggedValue tag="package" value="idD387F10"/>
                                               <UML:TaggedValue tag="gentype" value="BDS"/>
                                               <UML:TaggedValue tag="tagged" value="0"/>
                                               <UML:TaggedValue tag="package_name" value="AssocConstraintTest"/>
                                               <UML:TaggedValue tag="phase" value="1.0"/>
                                               <UML:TaggedValue tag="complexity" value="1"/>
                                               <UML:TaggedValue tag="status" value="Proposed"/>
                                         </UML:ModelElement.taggedValue>
                                   </UML:Class>
                                   <UML:Class name="Class2" visibility="public" isLeaf="false" xmi.id="idD3AE7E0" isRoot="false" isAbstract="false" namespace="idD387F10" isActive="false">
                                         <UML:ModelElement.taggedValue>
                                               <UML:TaggedValue tag="isSpecification" value="false"/>
                                               <UML:TaggedValue tag="ea_stype" value="Class"/>
                                               <UML:TaggedValue tag="ea_ntype" value="0"/>
                                               <UML:TaggedValue tag="version" value="1.0"/>
                                               <UML:TaggedValue tag="package" value="idD387F10"/>
                                               <UML:TaggedValue tag="gentype" value="BDS"/>
                                               <UML:TaggedValue tag="tagged" value="0"/>
                                               <UML:TaggedValue tag="package_name" value="AssocConstraintTest"/>
                                               <UML:TaggedValue tag="phase" value="1.0"/>
                                               <UML:TaggedValue tag="complexity" value="1"/>
                                               <UML:TaggedValue tag="status" value="Proposed"/>
                                         </UML:ModelElement.taggedValue>
                                   </UML:Class>
                                   <UML:Association visibility="public" isLeaf="false" xmi.id="idD3A2610" isRoot="false" isAbstract="false">
                                         <UML:ModelElement.constraint>
                                               <UML:Constraint name="indexed">
                                                     <UML:ModelElement.taggedValue>
                                                           <UML:TaggedValue tag="type" value="Invariant"/>
                                                           <UML:TaggedValue tag="description" value="true"/>
                                                     </UML:ModelElement.taggedValue>
                                               </UML:Constraint>
                                         </UML:ModelElement.constraint>
                                         <UML:ModelElement.taggedValue>
                                               <UML:TaggedValue tag="style" value="3"/>
                                               <UML:TaggedValue tag="ea_type" value="Association"/>
                                               <UML:TaggedValue tag="direction" value="Unspecified"/>
                                               <UML:TaggedValue tag="linemode" value="3"/>
                                               <UML:TaggedValue tag="seqno" value="0"/>
                                               <UML:TaggedValue tag="headStyle" value="0"/>
                                               <UML:TaggedValue tag="lineStyle" value="0"/>
                                               <UML:TaggedValue tag="virtualInheritance" value="0"/>
                                         </UML:ModelElement.taggedValue>
                                         <UML:Association.connection>
                                               <UML:AssociationEnd multiplicity="" isNavigable="true" name="the1_" visibility="public" isOrdered="false" aggregation="none" type="idD35DCA0">
                                                     <UML:ModelElement.taggedValue>
                                                           <UML:TaggedValue tag="containment" value="Unspecified"/>
                                                     </UML:ModelElement.taggedValue>
                                               </UML:AssociationEnd>
                                               <UML:AssociationEnd multiplicity="*" isNavigable="true" name="the2_" visibility="public" isOrdered="false" aggregation="none" type="idD3AE7E0">
                                                     <UML:ModelElement.taggedValue>
                                                           <UML:TaggedValue tag="containment" value="Unspecified"/>
                                                     </UML:ModelElement.taggedValue>
                                               </UML:AssociationEnd>
                                         </UML:Association.connection>
                                   </UML:Association>
                             </UML:Namespace.ownedElement>
                       </UML:Package>
                 </UML:Namespace.ownedElement>
           </UML:Model>
     </XMI.content>
</XMI>

SebastienRoy

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Xmi import : pb with constraints on associatio
« Reply #3 on: July 05, 2004, 05:41:56 am »
I have performed some further import tests :
    [*]In a simple model composed with two classes and one association, I define a constraint on the association (like in the code of the previous msg). I export the model in Xmi format.
    [*]When I re-import the as-generated file, the constraint on the association is still present.
    [*]In the xmi file, I remove the documentation element of the header, in order to simulate a home-generated xmi.
    [*]When I import this second xmi file, the constraint in not present in the model.
    [/list]

    This behaviour is like if there were two different xmi import modules. One is used when a EA xmi is detected (according to the header content), the other is used in the generic import case. In this last case, the constraints on associations seam not be taken into account.

    The remove part of the file is the following:
    Code: [Select]

    <XMI.documentation>
     <XMI.exporter>Enterprise Architect</XMI.exporter>
     <XMI.exporterVersion>2.5</XMI.exporterVersion>
    </XMI.documentation>


    I hope this will help you

    Sebastien
    « Last Edit: July 05, 2004, 06:01:40 am by SebastienRoy »