Author Topic: Is there a way to change a class into an attribute??  (Read 130 times)

Richard Freggi

  • EA User
  • **
  • Posts: 302
  • Karma: +11/-5
    • View Profile
Is there a way to change a class into an attribute??
« on: July 30, 2020, 06:36:48 pm »
So I'm evaluating the Office integration MDG to import ~ 150K elements including classes, attributes and their dependencies into EA v. 1310.
You can read about my misadventures using this MDG in its own thread.
By now I can import Packages, classes and dependencies, but no way to import attributes (UML class properties) if I have the Element type specified.  The MDG documentation mentions importing attributes but they are really properties of EA's internal data structures like Style, IsDerived etc.  There is a choice to import attributes only in the MDG if you select "sample document has no data type" but I've not been able to import the attributes this way (cannot nest them in the parent class).

But it's straightforward to import nested *classes* (or other EA element types: requirements, contraints etc.)  as surrogates for the attributes.  The result is a class containing nested classes with all the names and properties of the attributes.  If I could then convert these to real SParx attributes, I'd be OK.  Does anybody know it this is possible, thanks!!!

Uffe

  • EA Practitioner
  • ***
  • Posts: 1773
  • Karma: +122/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Is there a way to change a class into an attribute??
« Reply #1 on: July 30, 2020, 11:41:21 pm »
Hi Richard,


There (most likely) isn't a way to do that, because classes and attributes are different categories of thing.

However, provided that there are no classes nested in other classes for other reasons, scripting it should be pretty easy.


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 11388
  • Karma: +295/-262
  • I'm no guru at all
    • View Profile
Re: Is there a way to change a class into an attribute??
« Reply #2 on: July 31, 2020, 05:14:26 am »
Honestly,  I would do the import with a script from the start on.

q.