Book a Demo

Author Topic: Extending existing elements with tags and attributes  (Read 6047 times)

MarcinG

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Extending existing elements with tags and attributes
« on: August 26, 2021, 09:52:57 pm »
Hi,

is there an easy way of extending/stereotyping existing elements e.g. UML Component with custom tags and/or attributes, in a way that each new Component element of given stereotype would inherit the list of defined attributes/tags ?
I did try to follow this article, but it is quite inacurate.  Also, tried using metaclasses with a base class of a Component, but still failed.  Help  :-X please.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Extending existing elements with tags and attributes
« Reply #1 on: August 27, 2021, 04:46:21 am »
Well, defining a profile with stereotypes (and putting that in a MDG) would be the way to go. The article you linked is just a special case so it would be guesswork for what you did wrong. IIRC you can also use template packaged to create TVs. I wouldn't recommend that, though.

q.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Extending existing elements with tags and attributes
« Reply #2 on: August 27, 2021, 09:01:00 am »
Creating a new MDG profile is the way to go but its never been as easy as it should be. Sparx Systems have attempted to make it easier by creating Profile helpers which I've not used as the profiles I've created were done before this was available.
All the info you need can be found in this guide.
https://www.sparxsystems.com/resources/user-guides/15.2/modeling/mdg-technologies.pdf
In summary you'll need to create 3 profiles and generated MDG
  • Stereotype Profile with tag values
  • Toolbox Profile on which you can add stereotypes and drag them onto a diagram
  • Diagram Profile to hook the toolbox onto
  • Generate the MDG with the profiles
Expect to take a couple of days trying to follow this and fixing errors.

I've know some take an alterative approach of defining stereotypes in the model then creating JavaScript/VBScript scripts to add the tag values to elements with stereotype. However that will like take a couple of days for people who aren't familiar with scripting in EA but have some knowledge of those languages. But it isn't recommended as its a bit of a hack.

Hope that helps.

Happy to help
:)

MarcinG

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Extending existing elements with tags and attributes
« Reply #3 on: August 30, 2021, 06:50:36 pm »
Thank you all, I will give it a shot and keep digging.