Author Topic: Overriding Archimate3 stereotypes - missing color  (Read 5734 times)

DanielB

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Overriding Archimate3 stereotypes - missing color
« on: January 16, 2018, 11:26:30 pm »
Hi,

I've seen that creating custom MDG on top of Archimate has been quite popular topic lately.  Hope you could help me as well.

I'm creating custom MDG for my architecture metamodel on top of Archimate3. So far it's been good, I've manage to extend stereotypes with some predefined tagged values and additional attributes. Then I moved onto toolbox, managed to create pages and assign my new objects to it. Objects work fine, I can add them to a diagram. They even have Archimate3 icons.

The problem is, however, withe their colors. Although icons are inherited from Archimate3 colors seem to be inherited from UML standard. Am I doing something wrong or is it a known "feature"/misconception?

See the picture below in case I didn't describe the problem clearly:

https://imgur.com/a/aW1i5


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Overriding Archimate3 stereotypes - missing color
« Reply #1 on: January 16, 2018, 11:37:07 pm »
You can manipulate the color by setting the default color of your stereotype element, and then make sure you include the appearance when saving your UML profile.

Geert

PS. Are you sure you are extending the Archimate stereotype correctly? I seem to remember that you need to use the base metaclass as well.

DanielB

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Overriding Archimate3 stereotypes - missing color
« Reply #2 on: January 17, 2018, 12:05:21 am »
Hi Geert,

Thank you very much for a quick response. It seems that sparx will never stop to amazing me :) Setting default color resolved the problem. But here is the story.

When you are extending custom stereotype, like Archimate you get:
 - the right color in a toolbox
 - the right icon in an element on a diagram
 - the right shape on a diagram
but not the right color on a diagram.

Another funny thing is how you set up the right color. Instead of some special attribute on the element in your profile you need to choose it from the context menu and actually set up the default color of the inherited stereotype. Same with page order in a toolbox, instead of special attribute you're using Z-order from the context menu. Why this is must be so complicated? :)

Anyway thanks again for the prompt answer and maybe one more question.

Is there any other way to see the results of profile changes than:
1. Exporting profile + toolbox
2. Creating MDG (with the profile and the toolbox)
3. Importing MDG to a model
?

P.S. I hope that I'm extending Archimate stereotype correctly. Base metaclass is used when you want to add your extended stereotype to a toolbox (another unexpected behavior).

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Overriding Archimate3 stereotypes - missing color
« Reply #3 on: January 17, 2018, 12:56:30 am »
Daniel,

If you export you UML profile from the package instead of the diagram the order in the project browser will be used instead of the z-order.
That is my preferred way of working.

No, I don't know of another way to verify the results.

Geert

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Overriding Archimate3 stereotypes - missing color
« Reply #4 on: January 17, 2018, 03:26:44 am »
Daniel
To verify a stereotype definition -> once you save your profile, you can import it in your Resources Window -> UML Profile, this will allow you to drag and drop your stereotypes into a diagram and verify your results.


FWIW - I've noticed that The  color of your extended stereotype goes to the native color is due to the order of stereotype (in the stereotypeex field), When we remove the Archimate stereotype and reapply the color will be usually corrected.  But this isn't always a reliable solution.

Nizam

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Overriding Archimate3 stereotypes - missing color
« Reply #5 on: January 17, 2018, 11:03:15 am »
Daniel
To verify a stereotype definition -> once you save your profile, you can import it in your Resources Window -> UML Profile, this will allow you to drag and drop your stereotypes into a diagram and verify your results.


FWIW - I've noticed that The color of your extended stereotype goes to the native color is due to the order of stereotype (in the stereotypeex field), When we remove the Archimate stereotype and reapply the color will be usually corrected.  But this isn't always a reliable solution.

Nizam
(my emphasis)
Which is (one of the reasons) why we stopped using multiple stereotypes getting on for a decade ago.  Each element has only ONE stereotype (used to define the metatype).  All other uses of "stereotypes" are catered for by using various properties (including tagged values).

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Overriding Archimate3 stereotypes - missing color
« Reply #6 on: January 17, 2018, 11:11:23 am »
Like there is no multiple inheritance. An amphibian does not inherit from fish and mammal. It's an own breed which shares a couple of properties with either of the latter.

q.