Book a Demo

Author Topic: Bulk generation of classes, attributes and connectors.  (Read 5113 times)

Ian Mitchell

  • EA User
  • **
  • Posts: 507
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Bulk generation of classes, attributes and connectors.
« on: March 25, 2020, 01:54:37 am »
As part of the output of the Model Expert addin, I generate a whole load of classes, with lots of attributes and connectors (the meta-model of part of a model).
At the moment, I create these class-by-class, and add each attribute (trying to minimize the number of 'refresh' requests.), then create connectors.
It's kind-of fun to watch the EA PB creating them all, but frustrating if the MM is very large.
Does anyone know of a way to bulk-create this data set? It's 100% self contained (doesn't link to any other elements).
I thought about creating an XMI of my own, then importing it, but the lockdown in the UK is only supposed to last 3 months, so I might not have time.
Any other ideas?
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Bulk generation of classes, attributes and connectors.
« Reply #1 on: March 25, 2020, 02:02:01 am »
I found that disabling GUI updates makes a bit of a difference

Code: [Select]
Repository.EnableUIUpdates = false
I've managed to get to a really acceptable speed when creating stuff with my Excel importer that way. (few thousand attributes in under a minute)

If that is still too slow for you then think I would rather go for the "insert directly into database" option using the infamous Repository.Execute()

Geert

Ian Mitchell

  • EA User
  • **
  • Posts: 507
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: Bulk generation of classes, attributes and connectors.
« Reply #2 on: March 25, 2020, 02:08:40 am »
OOOO - I never knew that - I'll give it a try.
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Ian Mitchell

  • EA User
  • **
  • Posts: 507
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: Bulk generation of classes, attributes and connectors.
« Reply #3 on: March 25, 2020, 02:13:42 am »
Only about 500x faster!!!!
You may now wear the Hat of Extreme Cleverness for the rest of the afternoon.
Thanks Geert
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

pvickers

  • EA User
  • **
  • Posts: 44
  • Karma: +7/-0
    • View Profile
Re: Bulk generation of classes, attributes and connectors.
« Reply #4 on: March 25, 2020, 03:37:08 am »
Great tip Geert - I didn't know about this one either.
Very timely for me since I'm working on a program at the moment where this is going to be essential.

Geert's beer counter is now:
9,799 posts...at 1 beer per post, that's about 3,772 litres!

Thanks,
Perry

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Bulk generation of classes, attributes and connectors.
« Reply #5 on: March 25, 2020, 04:24:44 am »
Only about 500x faster!!!!
You may now wear the Hat of Extreme Cleverness for the rest of the afternoon.
Thanks Geert
Great ;D

The only downside is that you now can't sit back and watch EA working for you

Geert