Author Topic: [Ask] Import/Export attributes of each class - Done  (Read 964 times)

demian824

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
[Ask] Import/Export attributes of each class - Done
« on: July 06, 2023, 05:58:03 am »
Hello Professors,

I am looking for how to import or edit/sync attributes in classes. I tried to use a 'EA Excel import-export' from bellekens.com.
However, all attributes are not imported from the excel file. Only I can import classes.

Could you please help to solve this issue?

Thanks,

WonChul Choi
« Last Edit: July 19, 2023, 05:56:57 am by demian824 »

Richard Freggi

  • EA User
  • **
  • Posts: 473
  • Karma: +18/-7
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #1 on: July 06, 2023, 02:25:28 pm »
it means you are not filling in the excel sheet with the correct values.  For example you need the eaguid to import attributes, so you would need to run the importer for classes only, then export the classes with their eaguid, add the attributes and then import the attributes.  The importer is very reliable and never had any issues (importing 400K total of objects and attributes)

demian824

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #2 on: July 07, 2023, 02:39:48 am »
Hello Richard

I used VBA tool 'Export' and 'Import' on the excel file, but it occurred the run time error '-2146232576 (80131700)'.
when I used MDG importer, I filled up GUID and Parents Element name with other information on excel file. However, attributes were not imported. Only classes are imported

ps: Both functions 'eaConn.getPackageTreeIDString(parentPackage)' and 'importAttribute(properties As Dictionary, owner As EA.element, datatypes As Dictionary, pos As Integer)' on VBA are causes of run time error on Export-import excel tool.

Thanks,

WonChul Choi
« Last Edit: July 07, 2023, 03:42:03 am by demian824 »

Richard Freggi

  • EA User
  • **
  • Posts: 473
  • Karma: +18/-7
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #3 on: July 07, 2023, 05:45:33 pm »
Maybe Geert is on holiday, need his input.
You need the Excel importer from the github respository for the 64 bit version of EA 16: the one in bellekens.com does not work in 64 bit.
Geert will fill in info when he's back.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12654
  • Karma: +523/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [Ask] Import/Export attributes of each class
« Reply #4 on: July 07, 2023, 08:53:37 pm »
Maybe Geert is on holiday, need his input.
You need the Excel importer from the github respository for the 64 bit version of EA 16: the one in bellekens.com does not work in 64 bit.
Geert will fill in info when he's back.
Not on holidays yet. There's no issue with the 64 bit, but a change in the API that doesn't allow to create attributes with an empty name anymore, but I'm not sure if that runtime error would be due to that.
It might also be an issue with the reference to the EA.Interop.dll

Geert

demian824

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #5 on: July 10, 2023, 11:55:29 pm »
Hello,

To me, I only can use tagged value on Version 5. I can import classes & attribute on 4.2.
Is there anyway to create tagged values when I import elements by the file version 4.2?

Thanks,

WonChul Choi 

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12654
  • Karma: +523/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [Ask] Import/Export attributes of each class
« Reply #6 on: July 10, 2023, 11:57:29 pm »
Hello,

To me, I only can use tagged value on Version 5. I can import classes & attribute on 4.2.
Is there anyway to create tagged values when I import elements by the file version 4.2?

Thanks,

WonChul Choi
Why can't you create attributes with version 5?
Is there an error?

Geert

demian824

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #7 on: July 11, 2023, 12:27:29 am »
On version 4, there is no issue to use to me.

However, on version 5, Export_Import functions are not worked.
When I import the data, it keep making run time error that 'Name cannot be blank' although I filled all fields.
When I try to export from Sparx it made runtime error too. It said 'Automation error'

Only Tagged values functions are worked well.

Thanks,

WonChul Choi
« Last Edit: July 11, 2023, 12:32:50 am by demian824 »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12654
  • Karma: +523/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [Ask] Import/Export attributes of each class
« Reply #8 on: July 11, 2023, 12:34:50 am »
The "name cannot be blank" error can be fixed by adding a dummy name in the code. Look for attributes.AddNew("" and replace with attributes.AddNew("dummy"

I'll publish a new version once finished.

Geert

demian824

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #9 on: July 11, 2023, 12:47:06 am »
Hello Geert,

Now, I can import data. However exporting still does not working to me. It made a run time error on excel or sparx.
I already mentioned the run time error from excel.
Another case, Sparx showed me the message that 'Microsoft Acess Database Engine[0x80004005] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect'
Do I make a mistake to use the export function?

Thanks,

WonChul Choi

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12654
  • Karma: +523/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [Ask] Import/Export attributes of each class
« Reply #10 on: July 11, 2023, 01:52:20 am »
Hello Geert,

Now, I can import data. However exporting still does not working to me. It made a run time error on excel or sparx.
I already mentioned the run time error from excel.
Another case, Sparx showed me the message that 'Microsoft Acess Database Engine[0x80004005] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect'
Do I make a mistake to use the export function?

Thanks,

WonChul Choi
In that case you'll have to adapt the SQL query in the configuration tab. There might be an issue with something like "Default" or similar.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13380
  • Karma: +387/-299
  • I'm no guru at all
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #11 on: July 11, 2023, 01:53:43 am »
Look into %appdata%...Sparx where's a dberror.txt. That should contain the bad SQL.

q.

demian824

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #12 on: July 11, 2023, 04:56:57 am »
Where can I find the dberror.txt file? I cannot find any error log file in my program directory.

Thanks,

WonChul Choi

qwerty

  • EA Guru
  • *****
  • Posts: 13380
  • Karma: +387/-299
  • I'm no guru at all
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #13 on: July 11, 2023, 07:48:56 am »
It's %appdata%. Just type that (with the surrounding % chars) in the (uhm, it's not Finder; was it Explorer?) where you type the path (like C:\ or so). That will bring you somewhere where you find a Sparx directory (I'm currently with no access to Windoze to this is from memory).

q.

demian824

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: [Ask] Import/Export attributes of each class
« Reply #14 on: July 19, 2023, 05:53:31 am »
Hello all,

Thanks for giving me advices! I finished all task!

Thanks,

WonChul Choi