Author Topic: Import XML  (Read 4837 times)

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Import XML
« on: April 15, 2010, 01:25:26 am »
Hi all,

Can anyone help me in importing an XML file into EA?

I'm trying to manually create a XML file that I can import into a blank EA model but I get the error message "Unknown Exporter or Version" and, of course, no log file written to help?

My XML consists simply of nested Use cases. I'm not sure whether it's something to do with not having GUIDs.

I tried exporting a model and then stripping out the GUIDs and anything pointing to them, using just the structure of the XML to define the nesting but that doesn't seem to work.

Any ideas?
Martin

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Import XML
« Reply #1 on: April 15, 2010, 01:38:12 am »
Hi Martin,

Can you explain why you're doing things this way?

From what you've written, I'm reminded of the old Irish saying:

"Sure, if Oi was going t'Dublin... Oi wouldn't start from here..."

If you explain the why, we might be able to point you in the right direction.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Import XML
« Reply #2 on: April 15, 2010, 04:39:05 pm »
Martin,

My experience with XMI is to stay as far away from it as possible.
In other words, if there is an alternative to xmi then use it.
In this case it could very well be that an excel import would be much easier.
But as Paolo said, it all depends on the use case [pun intented].

Geert

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Import XML
« Reply #3 on: April 15, 2010, 07:09:38 pm »
Thanks Paolo and Geert for responding.

The reason for doing this is a little strange. :o

We use EA for our modelling needs and it does just fine!  [smiley=thumbsup.gif]

I now want to create a cross-linked tree (actually nothing to do with modelling really) and be able to display and query it. I thought that EA would be able to do this for me. The data exists in an Access database and I wanted to create some method of inputting the data into EA. Below is a small example of how the XML could look - note the double use of 'Use Case5' to form the cross-linkage.

<?xml version="1.0" encoding="UTF-8"?>
<model xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns:fn="http://www.w3.org/2005/xpath-functions"
       xmlns:uml="http://schema.omg.org/spec/UML/2.1"
       xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
       name="Dependency">
    <package name="Use Case Model" >
      <usecase name="Use Case1">
         <usecase name="Use Case4" />
         <usecase name="Use Case2">
            <usecase name="Use Case5" />
            <usecase name="Use Case6" />
         </usecase>
         <usecase name="Use Case3">
            <usecase name="Use Case10">
               <usecase name="Use Case5" />
               <usecase name="Use Case12" />
               <usecase name="Use Case11" />
            </usecase>
            <usecase name="Use Case7" />
         </usecase>
      </usecase>
   </package>
</model>

I can create this via the GUI EA user interface - no problem. I guess what I really want it some (controllable) method of importing data into EA starting from scratch.

Does that make sense? Can it be done and can you help?

TIA
Martin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Import XML
« Reply #4 on: April 15, 2010, 07:18:54 pm »
Martin,

That usecase5 of yours is going to pose a problem (if you really want to refer to the same use case, and not to a use case that happens to have the same name) because a UML model is a strict hierarchical tree.
That means that any element can have at most one parent. In your example usecase5 has both usecase2 and usecase10 as parents.

Can you explain why you want all those nested use cases? That might help in suggesting alternative solutions.

Anyway, if you want to import something from scratch in EA I stronly suggest to use another method then xmi. It is simple a PITA to do anything directly in EA.

If I need to import stuff in EA I usually go for Excel. I've posted a little VBA example of an excel import on the community site. You might be able to adapt that, (or write something decent that does the same).

Geert

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Import XML
« Reply #5 on: April 15, 2010, 07:31:20 pm »
Hi Geert,

Thanks for the info. Let me have a look at your Excel posts. If there is an alternative from XMI, i'm all for it!!

The intreguing thing is that EA allows me to create the cross-linked Use Case, and will export (and then import) it.

I'll get back to you. :)

Martin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Import XML
« Reply #6 on: April 15, 2010, 07:36:22 pm »
Martin,

I doubt that EA allows you to create the same use case under two different parents. The db structure isn't even equipped to do so.
So if you see your usecase5 twice in a different location then it means there are two use cases with the same name 'usecase5'

Geert


PS. Here's the link to the VBA excel importer

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Import XML
« Reply #7 on: April 15, 2010, 07:37:25 pm »
HI Geert,

You mentioned "I've posted a little VBA example of an excel import on the community site."

Where do I find that?  :-[

Martin

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Import XML
« Reply #8 on: April 15, 2010, 07:42:57 pm »
Ok - sorry posts passed each other :D

Martin