Book a Demo

Author Topic: tagged values in XMI export  (Read 4842 times)

richi

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
tagged values in XMI export
« on: February 05, 2008, 05:24:14 am »
Hy @ll,

I have some problems with tagged values in a UML Profile when I export my model to XMI. If an element has more then one tagged values only the first will be exported to XMI!

My aim is to extend Statechart transitions with two variables. I created a profile where I extend a stereotype from Metaclass “Transition” and added the stereotype two tagged values “var1” and “var2”.
Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">

<Documentation id="9EA7180C-9" name="TestProfile" version="1.0" notes="TestProfile"/>

<Content>


<Stereotypes>



<Stereotype name="MyTransition" notes="" cx="90" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">




<AppliesTo>





<Apply type="Transition">






<Property name="isEffect" value="false"/>






<Property name="kind" value=""/>





</Apply>




</AppliesTo>




<TaggedValues>





<Tag name="var1" type="" description="" unit="" values="" default=""/>





<Tag name="var2" type="" description="" unit="" values="" default=""/>




</TaggedValues>



</Stereotype>


</Stereotypes>


<TaggedValueTypes/>

</Content>
</UMLProfile>
When I import the UML Profile and create a transition I can edit the two tagged values. But when I export my model only one of the two tagged values will be exported and this in a strange way:


Code: [Select]
<TestProfile:MyTransition base_StateFlow="EAID_4F31A2F2_B356_4fca_8CE4_57192644D144" MyTransition="test1"/>

"test1" is the value of var1!
var2 is missing!

Is that a bug (I work with EA 7.0.818 build 818 ) or do I anything wrong?

thx
« Last Edit: February 05, 2008, 05:35:14 am by richi »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: tagged values in XMI export
« Reply #1 on: February 05, 2008, 06:09:21 am »
Which options do you have set for the XMI export?
No, you can't have it!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: tagged values in XMI export
« Reply #2 on: February 05, 2008, 06:15:50 am »
To which XMI version did you export your model? I'm not using XMI 1.*, but if you export to XMI 2.1 the tagged values for an element with ID $X should be under

Code: [Select]
xmi:XMI/xmi:Extension/elements/element[@xmi:idref=$X]/tags/tag

richi

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: tagged values in XMI export
« Reply #3 on: February 05, 2008, 06:37:37 am »
My options (think the standard export options):

Format XMI Output: true
Write Log File: true
Enable full EA Roundtrip: True
XMI Type: UML2.1 (XMI2.1)

Exported XMI-Model (only uml:Model)
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" xmlns:TestProfile="http://www.sparxsystems.com/profiles/TestProfile/1.0">
<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="EAPK_9BBB751E_0887_4f46_949B_CB12BBE0D994" name="Class Model" visibility="public">
<ownedComment xmi:type="uml:Comment" xmi:id="EAID_A3FAC08D_234E_4b14_A39E_78AE2C28E943" body="The Class Model is a logical model of the software system under construction. Classes generally have a direct relationship to source code or other software artifacts that can be grouped together into executable components. &#xA;&#xA;The System package contains the classes and artifacts which are being built or designed as part of the current model. The Frameworks package generally contains classes and components that have been designed and built earlier and are being reused as part of the current project."/>
<ownedComment xmi:type="uml:Comment" xmi:id="EAID_79ED971C_2FED_4544_BAA7_FB4D016357AD" body="Classes, interfaces and logical components for the new system"/>
<ownedComment xmi:type="uml:Comment" xmi:id="EAID_6A85FAF0_3DAD_4b1a_AFB2_38AA875B2192" body="Class libraries, API's and other re-usable components"/>
<packagedElement xmi:type="uml:StateMachine" xmi:id="EAID_SM000001_0887_4f46_949B_CB12BBE0D994" name="EA_StateMachine1" visibility="public">
<region xmi:type="uml:Region" xmi:id="EAID_SR000001_0887_4f46_949B_CB12BBE0D994" name="EA_Region1" visibility="public">
<subvertex xmi:type="uml:State" xmi:id="EAID_1D654D2C_1A3C_4a5e_85EE_48E76F592EF4" name="State1" visibility="public" isSubmachineState="false">
<outgoing xmi:idref="EAID_4F31A2F2_B356_4fca_8CE4_57192644D144"/>
</subvertex>
<transition xmi:type="uml:Transition" xmi:id="EAID_4F31A2F2_B356_4fca_8CE4_57192644D144" visibility="public" kind="local" source="EAID_1D654D2C_1A3C_4a5e_85EE_48E76F592EF4" target="EAID_EA2FF3E5_62E2_470d_A4A7_6591443C2898"/>
<subvertex xmi:type="uml:State" xmi:id="EAID_EA2FF3E5_62E2_470d_A4A7_6591443C2898" name="State2" visibility="public" isSubmachineState="false">
<incoming xmi:idref="EAID_4F31A2F2_B356_4fca_8CE4_57192644D144"/>
</subvertex>
</region>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="EAID_BBF421CC_E12F_4228_B1C4_AE3B0E1D260B" name="$help://class_model_pattern.htm" visibility="public"/>
<packagedElement xmi:type="uml:Class" xmi:id="EAID_F4226EB2_F425_4830_AE98_46F5C7F8F4B7" name="$help://classdiagram.htm" visibility="public"/>
</packagedElement>
<TestProfile:MyTransition base_StateFlow="EAID_4F31A2F2_B356_4fca_8CE4_57192644D144" MyTransition="test1"/>
<uml:Profile xmi:version="2.1" xmlns:uml="http://schema.omg.org/spec/UML/2.1/uml.xml" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmi:id="9EA7180C-9" nsPrefix="TestProfile" name="TestProfile" metamodelReference="mmref01">
<ownedComment xmi:type="uml:Comment" xmi:id="comment01" annotatedElement="9EA7180C-9">
<body>TestProfile Version:1.0</body>
</ownedComment>
<packageImport xmi:id="mmref01">
<importedPackage href="http://schema.omg.org/spec/UML/2.1/uml.xml"/>
</packageImport>
<packagedElement xmi:type="uml:Stereotype" xmi:id="MyTransition" name="MyTransition">
<ownedAttribute xmi:type="uml:Property" xmi:id="MyTransition-base_Transition" name="base_Transition" association="Transition_MyTransition">
<type href="http://schema.omg.org/spec/UML/2.1/uml.xml#Transition"/>
</ownedAttribute>
<ownedAttribute xmi:type="uml:Property" xmi:id="MyTransition-var2" name="var2">
<type href="http://schema.omg.org/spec/UML/2.1/uml.xml#String"/>
</ownedAttribute>
<ownedAttribute xmi:type="uml:Property" xmi:id="MyTransition-var1" name="var1">
<type href="http://schema.omg.org/spec/UML/2.1/uml.xml#String"/>
</ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:Extension" xmi:id="Transition_MyTransition" name="A_Transition_MyTransition" memberEnd="extension_MyTransition MyTransition-base_Transition">
<ownedEnd xmi:id="extension_MyTransition" name="extension_MyTransition" type="MyTransition" isComposite="true" lower="0" upper="1" memberEnd="extension_MyTransition MyTransition-base_Transition"/>
</packagedElement>
</uml:Profile>
</uml:Model>

richi

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: tagged values in XMI export
« Reply #4 on: February 05, 2008, 08:06:17 am »
Quote
To which XMI version did you export your model? I'm not using XMI 1.*, but if you export to XMI 2.1 the tagged values for an element with ID $X should be under

Code: [Select]
xmi:XMI/xmi:Extension/elements/element[@xmi:idref=$X]/tags/tag

Thanks Frank! That works fine!
I only was a little bit confused about finding the first tagged value in the xmi::model!