Book a Demo

Author Topic: XMI export still has DELETED model elements  (Read 13002 times)

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
XMI export still has DELETED model elements
« 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
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="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
Code: [Select]
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!
« Last Edit: July 31, 2020, 06:04:34 pm by mse »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #1 on: July 31, 2020, 10:10:26 pm »
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
« Last Edit: July 31, 2020, 10:12:12 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Nabil

  • EA User
  • **
  • Posts: 149
  • Karma: +5/-2
    • View Profile
    • View My LinkedIn Profile Here
Re: XMI export still has DELETED model elements
« Reply #2 on: August 03, 2020, 06:54:06 pm »
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
Nabil

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #3 on: August 03, 2020, 10:13:35 pm »
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.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #4 on: August 03, 2020, 10:33:12 pm »
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
My theories are always correct, just apply them to the right reality.

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #5 on: August 05, 2020, 10:56:18 pm »
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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: XMI export still has DELETED model elements
« Reply #6 on: August 05, 2020, 11:07:40 pm »
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

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #7 on: August 05, 2020, 11:18:48 pm »
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).

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #8 on: August 05, 2020, 11:22:16 pm »
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

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #9 on: August 06, 2020, 12:01:10 am »
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
My theories are always correct, just apply them to the right reality.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #10 on: August 06, 2020, 12:03:10 am »
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?

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #11 on: August 06, 2020, 10:54:57 pm »
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.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #12 on: August 06, 2020, 11:29:16 pm »
What version of Sparx EA are you using?

Nabil

  • EA User
  • **
  • Posts: 149
  • Karma: +5/-2
    • View Profile
    • View My LinkedIn Profile Here
Re: XMI export still has DELETED model elements
« Reply #13 on: August 06, 2020, 11:42:09 pm »
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
 
Nabil

dgoetz

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: XMI export still has DELETED model elements
« Reply #14 on: August 07, 2020, 07:59:46 pm »
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.