Author Topic: New MDG Technology, that extends another custom MDG Technology  (Read 2757 times)

TheAllSparx

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
New MDG Technology, that extends another custom MDG Technology
« on: December 07, 2022, 10:14:54 pm »
Global idea

I'm trying to build a new custom MDG Technology, that extends another custom MDG Technology, like this:

NewCustomMDG --(is extension of)--> ExistingCustomMDG -- (is extension of) --> UML Structural

Thus, to be more precise:
  • ExistingCustomMDG extends «UML Class» and «UML Attribute»;
  • I want to extend some stereotypes from ExistingCustomMDG in my NewCustomMDG, in order to add a couple of tagged values.

Aim


My aim is to provide users with a toolbox that encaptures all the stereotypes from the ExistingCustomMDG, plus some new stereotypes I defined in NewCustomMDG.
Additionally, these new stereotypes should contain all the tagged values from its 'extension class' or 'supertype', plus the newly added tagged values, thus not only the latter!
Furthermore, I would like to organize this in a way that takes into account other possible extensions of ExistingCustomMDG in the future.

Approach

I followed the steps described here: https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/addingelementsandmetaclass.html. However, step 2 does not clearly describe how to access the stereotypes you want to extend. The way I managed to do so, was by importing the ExistingCustomMDG on the 'Resources' tab first. After that, the stereotypes from ExistingCustomMDG I want to extend, became available in the 'Extend Metaclass' dialog.

Problem

I can't find clear documentation about an appropriate package and profile structure. Is there some kind of a best practise for the structure?
How do you refer in the «toolbox profile» to the new profile and the stereotypes from ExistingCustomMDG?
I found a way to do the latter, but for the new profile I get a 'Missing base type' error.

Please let me know if any additional information is needed
« Last Edit: December 08, 2022, 06:43:21 am by TheAllSparx »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #1 on: December 08, 2022, 12:00:03 am »
You'll need have the existing MDG in order to be able to extend it.
You can import it into the database, or reference the MDG files, that doesn't really matter.

Once available, you can drop a metaclass from the toolbox onto your profile diagram. There you have an option to select an existing stereotype.
Since this is strictly name based, you can also type the name of the stereotype yourself using Profile::StereotypeName.
Just make sure it's exactly the same as in the MDG (included uppercase/lowercase)

As for the package structure, there are two patterns you can use from the create model wizard.
One is only the package structure, the other contains some examples.

Geert

TheAllSparx

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #2 on: December 08, 2022, 03:14:19 am »
Hello Geert,

I allready used the existing MDG (Resources > MDG Technologies > Model Technologies > Import Technology). I added a metaclass from the toolbox onto the profile diagram and for the package structure I used the Model Wizards MDG basic template, but I was wondering if there is a good practise for building extensions on extensions. The way you describe it, every extension seems to have a separate package that contains its own profiles).

Anyway, the problem is, that in the 'Add Toolbox Page' dialog, I should be able to use the 'Add' button to add a stereotype. Although I can select the newly created stereotype, it will not added to the list ... Is there something I'm missing?
« Last Edit: December 08, 2022, 06:44:50 am by TheAllSparx »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #3 on: December 08, 2022, 04:21:19 am »
Anyway, the problem is, that in the 'Add Toolbox Page' dialog, I should be able to use the 'Add' button to add a stereotype. Although I can select the newly created stereotype, it will not added to the list ... Is there something I'm missing?

Can you post (a link to) an image of what exactly you are having issues with?

Geert

TheAllSparx

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #4 on: December 08, 2022, 06:42:19 am »
Yeah sure! I put four images online so you can follow my proces: https://github.com/Geonovum/MIM-Werkomgeving/tree/master/UML%20profieltooling/troubleshooting_temp

1 | Package structure
2 | Adding DiSGeo stereotypes as an 'extention' (apparently a «Generalization» is needed) of MIM metamodel
3 | Add stereotypes to Toolbox page
4 | I can select them, but they don't appear

(Is there a way to include them into this post? Or is that blocked due to my novice status?)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #5 on: December 08, 2022, 09:06:27 am »
Ah, the MIM, I used to help build that profile a few years ago :)

Yeah, there seems to be a bug in the profile helper that requires you to also extend a UML metatype.

So your stereotype should have a Specialization to the MIM:: stereotype, and a Extension to the UML metatype (Attribute in the case of Attribuutsoort)

Then the profile helper will be able to add the stereotypes on the toolbox.

Geert


TheAllSparx

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #6 on: December 09, 2022, 07:17:53 pm »
Yes, your name sounds familiar too. So I am pleased you also know the content.

Of all the things I tried, I excluded that one. I reasoned that adding a UML type too, the MIM type would be bypassed. But this solves that problem indee: adding the UML type allowes me to add the stereotypes to the toolbox page.

However, when I create a technology, the new stereotypes only contain the extra tagged values, but what I need is, for example, a new Attribute type that contains all the MIM::Attribuutsoort TV's (like in this diagram, plus the new TV's.

And additionally, I want all MIM's stereotypes in the toolbox, but not as a duplicate, but linked!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #7 on: December 09, 2022, 07:37:41 pm »
That should work.

I've done that before many times. If you generalize from MIM::Attribuutsoort, your derived stereotype should have all the MIM tagged values + the new tagged values you added.
For adding MIM::stereotypes to your toolbox, you might need to do that manually. Typing in the exact fully qualified name of the stereotype, and the base UML type

so MIM::Attribuutsoort(UML::Attribute) should give you a standard MIM Attribuutsoort.

Just to be clear; for this to work you'll need both the MIM MDG as your own MDG to be available in your model.

Geert

PS. If you are only looking to overwite some of the standard MIM steroetype with your own version, you can do that without needing to replicate all the toolboxes.
See https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_frameworks/redefine_ster_other_prof.html

TheAllSparx

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #8 on: December 15, 2022, 10:03:03 pm »
Hello Geert,

Thanks for your help! I got it (almost) working the way I initially expected. I was wondering: is there a way to manipulate the order of total set of tagged values of my extended type? I added a couple of tagged values. Their order I can set in the Features dialog, but since the inherited tagged values do not appear there (not even when I set the Compartment Visibility to show 'inherited tags'), I don't know how to do that for the totaal set of tagged values. It's a minor issue, but if it is possible, it would be nice to know!

Your suggestion on overwriting some of the standard MIM stereotypes is very interesting. Replicating all the toolboxes is a bit tedious indeed. It might be a better solution for this specific case, but as I mentioned before, I need a solution for a broader set of needs, so I have to look into that a bit further.

Gerard




Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #9 on: December 15, 2022, 10:46:29 pm »
No, I don't think you can do anything about the order of the inherited tagged values. You can only order the tagged values you added yourself.

What you can do is hide some of the inherited tagged values.

Geert

TheAllSparx

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #10 on: December 16, 2022, 09:28:57 pm »
Hello Geert,

"No, I don't think you can do anything about the order of the inherited tagged values." Ok, good to know.


Gerard

TheAllSparx

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #11 on: December 16, 2022, 09:42:05 pm »
I am trying to use the Redefine Stereotypes in Another Profile approach, but it is not completely clear to me how this should be set up. I should have mentioned it before, but I am using EA 15.2.

  • I can't find the «redefines» stereotype in EA. Therefore I just used a «Generalization» and added a new stereotype «redefines»...
  • Do you create just a profile or a complete new MDG? I interpreted is as just creating a profile that you need to import along with the MDG you're overriding.

However, this doesn't do the trick  :-\

Gerard


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #12 on: December 16, 2022, 10:35:28 pm »
You indeed need to create the redefines stereotype yourself.

You need to create your own profile, in your own MDG.

Then you need to set it to be the Active MDG in the technologies window.
That will tell EA which MDG takes precedence.

Geert

TheAllSparx

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: New MDG Technology, that extends another custom MDG Technology
« Reply #13 on: January 11, 2023, 11:30:33 pm »
Hello Geert,

I got it all working the way I want.

Great thanks for your help!

Grtz.
Gerard