Book a Demo

Author Topic: Can <DiagramProperties> be inherited?  (Read 8910 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Can <DiagramProperties> be inherited?
« on: August 20, 2020, 08:14:40 pm »
I'm prefacing this with the proviso that I'm using a hand-crafted MDG.

Can <DiagramProperties> be inherited (via abstract metatypes) - analogously to Property Tags?
It would appear not.  Can anyone confirm?

I tried to set some up with our small test model-based MDG with NO success.  I created a «diagram property» stereotyped attribute in the appropriate «stereotype» item.  It seemed to create the right output:
Code: [Select]
<Stereotype name="Root" metatype="Root (Concept)" notes="" cx="570" cy="92" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<AppliesTo>
<Apply type="Class">
<Property name="isActive" value=""/>
</Apply>
</AppliesTo>
<DiagramProperties>
<DiagramProperty name="IsRed" option="Red?" default="0"/>
</DiagramProperties>
</Stereotype>
When I created the item from the toolbox,
Code: [Select]
<Stereotype name="Vrtx" metatype="Generic (vertex)" notes="" cx="155" cy="62" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="Root" baseStereotypes="Root">
</Stereotype>
there was the User Specific Diagram Property (USDP) (i.e. IsRed) in the context menu.
Created an item from a metatype that inherits from Root, but there was NO USDP!

If someone has managed to make USDPs inherit, please can you share?

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

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #1 on: August 21, 2020, 07:31:29 am »
Quote
I'm prefacing this with the proviso that I'm using a hand-crafted MDG....
Sorry mate, you're on your own there. I use Sparx Model to create the MDG's

Quote
Can <DiagramProperties> be inherited (via abstract metatypes) - analogously to Property Tags?
It would appear not.  Can anyone confirm?
No idea. You could try creating it in the model and generating the MDG. If it works copy and paste the XML into your hand-crafted MDG.
« Last Edit: September 04, 2020, 02:21:50 pm by Sunshine »
Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #2 on: August 21, 2020, 08:00:28 am »
Quote
I'm prefacing this with the proviso that I'm using a hand-crafted MDG....
Sorry mate, your on you own there. I use Sparx Model to create the MDG's

Quote
Can <DiagramProperties> be inherited (via abstract metatypes) - analogously to Property Tags?
It would appear not.  Can anyone confirm?
No idea. You could try creating it in the model and generating the MDG. If it works copy and paste the XML into your hand-crafted MDG.
(my emphasis)
That's what I did, Sunshine.  Those code segments ARE from the Sparx Model generation!

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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #3 on: August 31, 2020, 05:02:12 pm »
[BUMP]

Anybody?

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

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #4 on: September 04, 2020, 02:24:05 pm »
...
That's what I did, Sunshine.  Those code segments ARE from the Sparx Model generation!

Paolo
Did they work in the generated MDG before you copied them?
Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #5 on: September 04, 2020, 04:57:12 pm »
...
That's what I did, Sunshine.  Those code segments ARE from the Sparx Model generation!

Paolo
Did they work in the generated MDG before you copied them?
No, I don't think so, but I can't recall.  Are they working for you?

All the other stuff I've copied from the generated model worked fine...  So I wasn't expecting this NOT to work.  Also, the Sparxian silence is suggestive...

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

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #6 on: September 08, 2020, 08:33:39 am »
...
That's what I did, Sunshine.  Those code segments ARE from the Sparx Model generation!

Paolo
Did they work in the generated MDG before you copied them?
No, I don't think so, but I can't recall.  Are they working for you?

All the other stuff I've copied from the generated model worked fine...  So I wasn't expecting this NOT to work.  Also, the Sparxian silence is suggestive...

Paolo
Haven't tried inherited relationship for diagrams. Just used extends.
Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #7 on: September 08, 2020, 09:55:28 am »
[SNIP]

Haven't tried inherited relationship for diagrams. Just used extends.
Sorry Sunshine, it's not clear.
Are you saying you haven't tried what I'm trying?  Or that you used a different technique to do the same thing?

Paolo

[Edit:  FWIW, I tried the MDG generator again and as far as I can see, it generated the correct stuff in the ancestry, but the descendants DID NOT inherit the <DiagramProperties>.]
« Last Edit: September 08, 2020, 11:43:20 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #8 on: September 10, 2020, 09:50:47 am »
Sorry Sunshine, it's not clear.
Are you saying you haven't tried what I'm trying? ...

Paolo

[Edit:  FWIW, I tried the MDG generator again and as far as I can see, it generated the correct stuff in the ancestry, but the descendants DID NOT inherit the <DiagramProperties>.]
Yes - I've not tried what you are suggesting. I don't think is possible either as I've searched the help and guides but didn't see anywhere it said you could use inherit relationship for diagrams either.
Sorry if I wasn't clear before.

Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can <DiagramProperties> be inherited?
« Reply #9 on: September 10, 2020, 10:09:39 am »
Sorry Sunshine, it's not clear.
Are you saying you haven't tried what I'm trying? ...

Paolo

[Edit:  FWIW, I tried the MDG generator again and as far as I can see, it generated the correct stuff in the ancestry, but the descendants DID NOT inherit the <DiagramProperties>.]
Yes - I've not tried what you are suggesting. I don't think is possible either as I've searched the help and guides but didn't see anywhere it said you could use inherit relationship for diagrams either.
Sorry if I wasn't clear before.

Thanks for clarifying, Sunshine!

And just to clarify from my side, the inheritance is between element metatypes.  The effect is on the diagram, but the inheritance is NOT on the diagrams.

The inheritance works within the metamodel (that is, the attributes that correspond to the <DiagramProperties> are inherited correctly - as one would expect), it's just that they are NOT generated, as required.

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can <DiagramProperties> be inherited?
« Reply #10 on: June 02, 2023, 08:38:28 pm »
Hi,

I'm trying to find how to define such diagramproperty to my stereotype, but I can't seem to find it in the manual.

Does anyone know how to do it, (or know the correct page in the manual)?

Thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can <DiagramProperties> be inherited?
« Reply #11 on: June 02, 2023, 09:08:18 pm »
Hi,

I'm trying to find how to define such diagramproperty to my stereotype, but I can't seem to find it in the manual.

Does anyone know how to do it, (or know the correct page in the manual)?

Thanks

Found it (but not where one would expect): https://www.sparxsystems.com.au/enterprise_architect_user_guide/16.1/modeling_frameworks/query_methods.html

Geert