Skip to main content



      Home
Home » Modeling » EMF » Reading XMI with non-XMI elements
Reading XMI with non-XMI elements [message #1871127] Mon, 16 September 2024 11:45 Go to next message
Eclipse UserFriend
I want to process a UML model created with Enterprise Architect (EA) and have exported it using their Publish tool as UML 2.5 / XMI 2.5.1.
I have a UML metamodel covering the necessary UML language elements, like Class, Package Property etc, and can load these parts from the XMI file. However, most of the content is within an xmi:Extension-element with a structure that does not seem to follow normal XMI structure:

	<xmi:Extension extender="Enterprise Architect" extenderID="6.5">
		<elements>
			<element xmi:idref="EAPK_403CB" xmi:type="uml:Package">
				<model package2="EAID_403CB" package="EAPK_FC2F" tpos="0" ea_localid="54939" ea_eleType="package"/>
				<properties isSpecification="false" sType="Package" nType="0" scope="public" stereotype="ApplicationSchema"/>
				<project author="haukdal_ivar" version="1.0" phase="1.0" created="2018-05-14 07:54:14" modified="2024-09-11 12:17:24" complexity="1" status="Proposed"/>
				<code gentype="Java"/>
				<style appearance="BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=1;HSwimLanes=1;BorderStyle=0;"/>
				<tags>
					<tag xmi:id="EAID_89E8" name="SOSI_kortnavn" value="BGF" modelElement="EAID_40CB"/>
					<tag xmi:id="EAID_5201" name="SOSI_langnavn" value="Bakkegeofysikk" modelElement="EAID_40CB"/>


E.g. the "elements" (or"tags") element seems to correspond to a feature (without instance creation) with contained "element" (or "tag") elements corresponding to the actual instances populating this features. This is contrary to XMI where elements named after a feature implicitly also corresponds to an instance (creation) with a type specified by xmi:type attributes. Also, the "element" element looks up an existing one using xmi:idref (supported by XMIHandler), but contains more elements which the XMIHandler does not support.

So far I've created a separate Extension class with the idea of creating classes corresponding to the contained elements, but will also need to handle the non-XMI structure. I'm wondering how the XMIHandler can be extended to handle these kind of elements,. or if the Extension class and the others I create can be configured/annotated to handle the above element structure.

Any suggestions?

Regards,

Hallvard Trætteberg
Re: Reading XMI with non-XMI elements [message #1871142 is a reply to message #1871127] Mon, 16 September 2024 16:02 Go to previous messageGo to next message
Eclipse UserFriend
You might want to ask on the UML2 forum instead:

https://www.eclipse.org/forums/index.php?t=thread&frm_id=117
Re: Reading XMI with non-XMI elements [message #1871244 is a reply to message #1871142] Wed, 18 September 2024 06:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi

xmi:Extension is an OMG-specified extension opportunity for tools. It is not a regular model Element so I doubt that defining Extension as a regular model class will help. The example you provide seems to add graphical value so you should be able to just ignore the extension for regular modeling purposes.

The EMF XMI support is fairly flexible so it should be able to read/ignore the xmi:Extension. When read, I would expect that you will find instances of XMI elements just as when you read XML with the reflective ecore model editor.

There are hooks for handling / reporting bad things which should enable you to ignore the xmi:Extension.

If you want to implement an xmi:Extension processor, I am sure that it is possible but perhaps not easy; you will need to spend time familiarizing yourself with the many extension opportunities.

You might try the UML group, but the FAQ is 'how do I read EA XMI' to which I respond recommending a manual edit to imitate a regular Eclipse UML2 file. The same probably applies to you, including manually delete the xmi:Extension elements.

Regards

Ed Willink
Re: Reading XMI with non-XMI elements [message #1871286 is a reply to message #1871244] Thu, 19 September 2024 07:23 Go to previous message
Eclipse UserFriend
In my case the xmi:Extension element includes important information here and there, including tagged values and basic types used by the main model, so I will need to dig into it. My plan is to model the stuff I need and make a custom XMIHandler that creates instances (of my model classes) from the relevant elements, while ignoring the rest.
Previous Topic:cdo_commit_infos table cleanup
Next Topic:CDOView is being invalidated forever
Goto Forum:
  


Current Time: Mon Jul 28 14:45:20 EDT 2025

Powered by FUDForum. Page generated in 0.03752 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top