Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: mse on July 31, 2020, 06:02:47 pm
-
I have Enterprise Architect Corporate edition, version 14.
When I create simple model and export the model to XMI, things appear to work. I run into trouble when I delete something from the model. WHen I export the model to XMI again, the deleted model elements are still there! How do I get the XMI to always reflect the true state of the model? Here is the XMI and the log (notice how some elements such as ports are not mentioned in the log). In the project browser I only have P_x and R_x ports. I deleted Port1 and newPort for example, yet they are still showing in the XMI.
XMI
<?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="EAPK_BCE962B3_871A_4702_BE64_391B6E80D66A" name="PkgXMI" visibility="public">
<packagedElement xmi:type="uml:Class" xmi:id="EAID_9EF6E623_25B3_4b50_A91D_269C691E30C4" name="Class2" visibility="public">
<ownedPort xmi:type="uml:Port" xmi:id="EAID_E350DCB5_E56B_4be5_8DEF_2C02C36DCD00" name="P_x" visibility="public" aggregation="composite" isService="true" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="EAID_AB744637_2EA9_42aa_822B_F43CBB3CD4C6" name="Class3" visibility="public">
<ownedPort xmi:type="uml:Port" xmi:id="EAID_183004D2_B45F_4b38_84C1_A17FEE224AB6" name="R_x" visibility="public" aggregation="composite" isService="true" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="EAID_65BF0A86_600A_42fb_8111_487DEF9E0D3A" name="CompositeClass" visibility="public">
<ownedAttribute xmi:type="uml:Property" xmi:id="EAID_12B59BD7_9C60_4a23_BA34_8D2BEB75F222" name="Property1" visibility="public" aggregation="composite" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false">
<type xmi:idref="EAID_9EF6E623_25B3_4b50_A91D_269C691E30C4"/>
<qualifier xmi:type="uml:Property" xmi:id="EAID_862ED6E3_6660_4e1a_BABC_D8FA39967FBC" name="Port1" visibility="public" associationEnd="EAID_12B59BD7_9C60_4a23_BA34_8D2BEB75F222" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
<qualifier xmi:type="uml:Property" xmi:id="EAID_6799FC21_D19D_491b_A388_8E440A674725" name="newPort" visibility="public" associationEnd="EAID_12B59BD7_9C60_4a23_BA34_8D2BEB75F222" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
<qualifier xmi:type="uml:Property" xmi:id="EAID_862ED6E3_6660_4e1a_BABC_D8FA39967FBC" name="Port1" visibility="public" associationEnd="EAID_12B59BD7_9C60_4a23_BA34_8D2BEB75F222" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
<qualifier xmi:type="uml:Port" xmi:id="EAID_72F2273E_5A64_49d4_8D9C_D63398BB535E" name="P_x" visibility="public" aggregation="composite" isService="true" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
</ownedAttribute>
<ownedConnector xmi:type="uml:Connector" xmi:id="EAID_0F2AAA5E_4850_4f40_BF68_AF8F62FC3DDA" name="C1" visibility="public">
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_SC000000_4850_4f40_BF68_AF8F62FC3DDA" role="EAID_72F2273E_5A64_49d4_8D9C_D63398BB535E"/>
<end xmi:type="uml:ConnectorEnd" xmi:id="EAID_DS000000_4850_4f40_BF68_AF8F62FC3DDA" role="EAID_BC53467D_B104_4d35_A30C_C7A52315EA35"/>
</ownedConnector>
<ownedAttribute xmi:type="uml:Property" xmi:id="EAID_1FAE505D_F63E_4770_A52E_E5746841E7BC" name="Property2" visibility="public" aggregation="composite" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false">
<type xmi:idref="EAID_AB744637_2EA9_42aa_822B_F43CBB3CD4C6"/>
<qualifier xmi:type="uml:Property" xmi:id="EAID_0DEC9E04_E4B5_45fc_88D4_FC30D97A1C3F" name="Port2" visibility="public" associationEnd="EAID_1FAE505D_F63E_4770_A52E_E5746841E7BC" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
<qualifier xmi:type="uml:Property" xmi:id="EAID_4CEB0724_4D77_494a_8319_81EDB93E1EB4" name="newPortR" visibility="public" associationEnd="EAID_1FAE505D_F63E_4770_A52E_E5746841E7BC" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
<qualifier xmi:type="uml:Property" xmi:id="EAID_0DEC9E04_E4B5_45fc_88D4_FC30D97A1C3F" name="Port2" visibility="public" associationEnd="EAID_1FAE505D_F63E_4770_A52E_E5746841E7BC" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
<qualifier xmi:type="uml:Port" xmi:id="EAID_BC53467D_B104_4d35_A30C_C7A52315EA35" name="R_x" visibility="public" aggregation="composite" isService="true" isStatic="false" isReadOnly="false" isDerived="false" isOrdered="false" isUnique="true" isDerivedUnion="false"/>
</ownedAttribute>
</packagedElement>
</packagedElement>
</uml:Model>
</xmi:XMI>
Log
Retrieving data for export: diagram elements
Retrieving data for export: links
Retrieving data for export: constraints
Retrieving data for export: attribute tagged values
Retrieving data for export: operation tagged values
Retrieving data for export: operation parameter tagged values
Retrieving data for export: connector tagged values
Completed data retrieval
Pre-processing export tree...
Completed pre-processing
Processing package: PkgXMI
Element:0: Class2
Element:1: P_x
Element:2: Class3
Element:3: R_x
Element:4: CompositeClass
Element:5: Property1
Element:6: P_x
Element:7: Property2
Element:8: R_x
Formatting output XML...please wait
XMI Document Export Complete!
-
In Sparx EA "deleted" is an AMBIGUOUS term which I NEVER use.
If objects have been purged from the repository they physically can't be in the export since they no longer exist in the repository.
If they have merely been removed from one or more diagrams, they then still exist in the repository and SHOULD be exported if they are in the scope of the export.
HTH,
Paolo
-
By looking at the XMI. I believe the content is still part of repository. You might have deleted from diagram which is diagram object. So if you traverse to diagram objects node you will not find it. As mentioned by Mr.Paolo
Thanks, Nabil
-
The way I deleted it was with right mouse click, context menu, then delete. It's very strange and easily reproducible. Only by deleting the parts and adding them again can I get the result I am looking for.
-
The way I deleted it was with right mouse click, context menu, then delete.
If you're in the context of a diagram, this doesn't delete the element from the model. It only removes it from the diagram, and the diagram doesn't auto-save either.
/Uffe
-
So how do I purge those deleted items then? I'm not connected to any repository. It is simply a model stored on my local disk drive.
-
A local .eap file is a repository as well. (MS Access database actually)
Look in your project browser. That is where you see (most) of your actual model.
The diagrams are simply views that show a part of this model.
Geert
-
So how do I purge those deleted items then? I'm not connected to any repository. It is simply a model stored on my local disk drive.
You have not deleted the elements, this is Uffe's point, you have just remove them from the diagram and kept them in the model. When you export to XMI, broadly speaking you are exporting a model and not a diagram.
The right click context menu should give you 2 delete options: remove/delete from diagram and delete from the model. Before the deletion takes place, it should also give you the option of choosing on of those 2 options as the default behaviour (although I rarely chose a default behaviour for delete).
-
That is precisely waht is confusing me. I cannot find those model elements anywhere in the project browser. Searching for them returns 0 results. I had deleted the port for example using right-click in the project browser and not the diagram. If I could somehow locate those "deleted" items I would delete them, but they are no where to be found and yet they still end up in the XMI export.
-
In that case it's time for an integrity check (Configure -- Model -- Integrity).
It doesn't catch everything that can go wrong in a project, but orphaned elements usually show up correctly.
/U
-
That is precisely waht is confusing me. I cannot find those model elements anywhere in the project browser. Searching for them returns 0 results. I had deleted the port for example using right-click in the project browser and not the diagram. If I could somehow locate those "deleted" items I would delete them, but they are no where to be found and yet they still end up in the XMI export.
Uffe beat me to it :)
What type of repository are you using? An eap or eapx file? A database? Anything else?
Do you have any baselines on the model?
-
It's an eapx file. I even created a new eapx file and repeated the steps and still got the same thing. I simply create a simple model with one class and two parts. Export to XMI, I then make a few changes like removing model elements (via project browser) and export again. You will notice that the XMI grows in size.
-
What version of Sparx EA are you using?
-
Creating a new file or multiple imports never help. You can do an integrity check proposed by Uffe. That should actually clears connectors which do not have source ID or Target ID means user delete source elements or target element . but I am not sure how it works for port you can give it a try. No Harm :)
Thanks,
Nabil Saleem
LinkedIn (https://www.linkedin.com/in/nabil-saleem-a6521b24/)
-
Have you tried to search for Orphan Elements? Just to be sure the elements are not hidden anywhere in the Project Browser.
Search > Model > Diagram Searches > Find Orphans.