Author Topic: MDG: How to stereotype a diagram?  (Read 2658 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6855
  • Karma: +144/-104
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
MDG: How to stereotype a diagram?
« on: April 06, 2010, 09:47:07 pm »
Is it possible to stereotype a diagram within an MDG Technology?

I can create a new diagram type.  But I'd also like to set a stereotype.  Is it possible?

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

Giuseppe Platania

  • EA User
  • **
  • Posts: 53
  • Karma: +2/-0
  • As above so below
    • View Profile
    • Linkedin
Re: MDG: How to stereotype a diagram?
« Reply #1 on: June 25, 2019, 12:54:29 am »
I know this is a very old question, but I still trying to find an answer to that.
Anyone?
Giuseppe Platania
Enterprise Architect
+++ +++ +++ +++ +++ +++ ++++
"As above so below, to accomplish the miracles of the One Thing" - Hermes Trismegistus, first Enterprise Architect

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6829
  • Karma: +65/-7
    • View Profile
Re: MDG: How to stereotype a diagram?
« Reply #2 on: June 25, 2019, 10:08:12 am »
No. The stereotype field on a diagram has no function.

What are you actually trying to achieve by setting the stereotype?
Eve

support@sparxsystems.com

Giuseppe Platania

  • EA User
  • **
  • Posts: 53
  • Karma: +2/-0
  • As above so below
    • View Profile
    • Linkedin
Re: MDG: How to stereotype a diagram?
« Reply #3 on: June 25, 2019, 10:44:22 pm »
I could check the property using shapescript and set shapes
Giuseppe Platania
Enterprise Architect
+++ +++ +++ +++ +++ +++ ++++
"As above so below, to accomplish the miracles of the One Thing" - Hermes Trismegistus, first Enterprise Architect

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9492
  • Karma: +266/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: MDG: How to stereotype a diagram?
« Reply #4 on: June 25, 2019, 10:59:50 pm »
You can check the MDG type of your diagram in a shape script:

Code: [Select]
if(hasproperty("diagram.mdgtype", "MyMDG::DiagramType"))
Geert

Giuseppe Platania

  • EA User
  • **
  • Posts: 53
  • Karma: +2/-0
  • As above so below
    • View Profile
    • Linkedin
Re: MDG: How to stereotype a diagram?
« Reply #5 on: June 26, 2019, 04:43:45 am »
Thank you Geert
Giuseppe Platania
Enterprise Architect
+++ +++ +++ +++ +++ +++ ++++
"As above so below, to accomplish the miracles of the One Thing" - Hermes Trismegistus, first Enterprise Architect

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6855
  • Karma: +144/-104
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: MDG: How to stereotype a diagram?
« Reply #6 on: July 11, 2019, 08:54:11 am »
You can check the MDG type of your diagram in a shape script:

Code: [Select]
if(hasproperty("diagram.mdgtype", "MyMDG::DiagramType"))
Geert
Yes, we do that, but we also want to have variants to change the shapes (or behaviour) we display.  We have «Presentation» diagrams (which display "Stakeholder" versions of shapes - via smart shapescripts) and we have «Aggregation» diagrams that aggregate (automagically) sets of objects for our "landscape" diagrams.  So we add stereotypes as required.  However, I can see that if they truly are the type specified, then the stereotype needs to be added separately.

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

adepreter

  • EA User
  • **
  • Posts: 128
  • Karma: +2/-2
    • View Profile
Re: MDG: How to stereotype a diagram?
« Reply #7 on: July 25, 2019, 12:42:37 am »
   if (hasproperty("diagram.stereotype", "Compact View"))
   {
      defsize(100,15);
      rectangle(0,0,100,100);
      print("#name#");
   }
   else if (hasproperty("diagram.stereotype", "Undecorated View"))
   {
      defsize(105,20);
      rectangle(0,0,100,100);
      addsubshape("paddingUndecoratedShape","n");
      addsubshape("nameUndecoratedShape","center");
      addsubshape("port","w");
   }
   else
   {
      defsize(90,70);
      rectangle(0,0,100,100);
      addsubshape("padding","n");
      addsubshape("name","center");
   }

adepreter

  • EA User
  • **
  • Posts: 128
  • Karma: +2/-2
    • View Profile
Re: MDG: How to stereotype a diagram?
« Reply #8 on: July 25, 2019, 12:48:59 am »
Here is a resulting diagram in compact view mode (name of the diagram stereotype).
http://www.labnaf.one/guidance/index.html?guid=65903864-3A6F-4e6e-B08F-B2AE10211896

These diagrams are generated automatically following diagram templates that can also include auto legends.
Benefits
- All the diagrams are complete
- Saving a lot of time and money
- All the diagrams have a consistent layout

adepreter

  • EA User
  • **
  • Posts: 128
  • Karma: +2/-2
    • View Profile
Re: MDG: How to stereotype a diagram?
« Reply #9 on: July 25, 2019, 12:55:43 am »
If you want to define it in the MDG, isn't simple to create a different diagram type and test the diagram type in the shape script?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6855
  • Karma: +144/-104
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: MDG: How to stereotype a diagram?
« Reply #10 on: July 25, 2019, 08:35:51 am »
If you want to define it in the MDG, isn't simple to create a different diagram type and test the diagram type in the shape script?
Yes, Alain,  that's the question I've been debating with myself at a conceptual/metamodel level.

What I'm after is to add a property to the diagram that I can test in the script, but diagrams are second class citizens and you can't.  So the stereotype is the only thing we have.

I want to be able to change the property at run time if necessary (which I can't -at least not so easily- if it's embedded in the type).  To your viewpoint discussion earlier today, it's the same View/ Viewpoint; just rendered differently.

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