Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: SebastienRoy on July 02, 2004, 07:40:29 am

Title: Xmi import : pb with constraints on associations
Post by: SebastienRoy 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
Title: Re: Xmi import : pb with constraints on associatio
Post by: Tjerk 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).
Title: Re: Xmi import : pb with constraints on associatio
Post by: SebastienRoy 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>
Title: Re: Xmi import : pb with constraints on associatio
Post by: SebastienRoy on July 05, 2004, 05:41:56 am
I have performed some further import tests :


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