Book a Demo

Author Topic: Change a Metaclass default colour via a UML profile?  (Read 4147 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Change a Metaclass default colour via a UML profile?
« on: September 13, 2018, 01:01:43 am »
Hi,

I need to define a default colour via an MDG with a UML profile on my stereotypes + default UML elements: Enumerations & Data types (see UML class toolbox -> Enumeration, Data Type)
The UML Types options makes it possible to define a colour for a stereotyped class e.g. datatype stereotyped class. However it doesn't let me change an Enumeration colour. Furthermore I'd like this to be set in the MDG instead of the EA clients options.

Is there any way to do that?

I hope it makes sense
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Change a Metaclass default colour via a UML profile?
« Reply #1 on: September 13, 2018, 07:55:04 am »
No, you can't change the metatypes in a profile.

My only recommendation is to use a template package.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Change a Metaclass default colour via a UML profile?
« Reply #2 on: September 13, 2018, 10:08:49 am »
No, you can't change the metatypes in a profile.

My only recommendation is to use a template package.
The profile only deals with stereotypes (that's why they're in the <Stereotype></Stereotype> section.  ;)).  But more seriously, the element that you are placing on the diagram and into the model is a null stereotyped instance of the metaclass (not the metaclass).

You're therefore caught in a Catch-22.  You can't define a null stereotype, because the metaclass isn't specified until after the stereotype is identified in the MDG.  IIRC you can't specify multiple entries with the same stereotype.

As Simon says, you have to use a template package to create a null stereotyped holotype therein to specify how to render it.

A million years ago, I asked for the facility to create null stereotyped shapescripts, but to no avail.  It would require a DB change (at least) to change the primary key for t_stereotypes to allow null stereotypes.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Change a Metaclass default colour via a UML profile?
« Reply #3 on: September 13, 2018, 03:18:39 pm »
As an alternative to the Template Package, I defined a script that resets the default background colour on the enum and data types.
It's working well but I need to run it on a regular basis.
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com