Sparx Systems Forum

Discussion => Automation Interface, Add-Ins and Tools => Topic started by: Svend Erik Nygaard on November 10, 2017, 02:18:34 am

Title: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Svend Erik Nygaard on November 10, 2017, 02:18:34 am
I created a custom diagram type in an MDG.

When I use the MDG, I can select my custom diagram type when I create a new diagram
BUT:
If I go to Design/Diagram/Manage/Change type... - then I can actually choose my new diagram type, but I still don't see any change in the diagram's type og stereotype.
The diagram pane's title bar does show the new customized stereotype though (<Steretype> diagram: <name>
EA also presents the associated toolboxes correctly
Does EA not set diagram type and stereotype in the usual fields (Diagram_Type and Stereotype) for a customized diagram?
I can see that it does include the name of my customized stereotype (CityMap) in the field StyleEx:
"MDGDgm=CPH_MetaModel::CityMap;HideQuals=0;HideConnStereotype=0;"
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Geert Bellekens on November 10, 2017, 04:27:06 am
I'm pretty sure what you saw is normal behavior for EA.

Geert
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: qwerty on November 10, 2017, 08:09:05 am
If you create any diagram from BPMN you see that they are Analysis diagrams and don't have a stereotype. It's only that EA knows the meta-type and associates a toolbox with the diagram.

q.
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Paolo F Cantoni on November 10, 2017, 11:00:19 am
If you create any diagram from BPMN you see that they are Analysis diagrams and don't have a stereotype. It's only that EA knows the meta-type and associates a toolbox with the diagram.

q.
Because Diagrams are 2nd (or lower) class citizens of the sparxian ecosystem, a diagram metatype is NOT a combination of Type and Stereotype, but just an entry in StylEx (as noted by the OP).

Getting Diagram stereotypes to appear in the dropdown has been problematic for us.  IIRC we found we had to place them in the General stereotypes list with a base class of Diagram to get them to show up.

Paolo
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Svend Erik Nygaard on November 10, 2017, 10:55:33 pm
IIRC we found we had to place them in the General stereotypes list with a base class of Diagram to get them to show up.

But that will not associate the MDG's diagram type with the general stereotype - correct?

Is there any way to add a stereotype (possibly as a default value) from within the MDG, to elements created from the MDG's diagram type?
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Geert Bellekens on November 10, 2017, 11:19:15 pm
IIRC we found we had to place them in the General stereotypes list with a base class of Diagram to get them to show up.

But that will not associate the MDG's diagram type with the general stereotype - correct?

Is there any way to add a stereotype (possibly as a default value) from within the MDG, to elements created from the MDG's diagram type?
I'm sorry I don't understand what you mean with "elements created from the MDG's diagram type"

Geert
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Svend Erik Nygaard on November 11, 2017, 12:51:45 am
I'm sorry I don't understand what you mean with "elements created from the MDG's diagram type"
Geert

Yeah, that was a bit of fast typing, sorry.

I mean:

I create a customized diagram type "CityMap" in my MDG.
Then, when the user creates a new CityMap diagram, I want EA to set the diagram's stereotype to "CityMap"
Is there any way, I can specify in my MDG, that the diagram should automatically be given the stereotype "CityMap" - for instance, can I, in my MDG, specify a default value for the Stereotype property?










Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Geert Bellekens on November 11, 2017, 06:49:14 pm
Ah, thanks that makes more sense.

No I don't think you can, but diagram stereotypes aren't really valid UML constructs you know.

Why is it so important that you have a stereotype on your diagrams? I've done a number of MDG with diagram types, and I never really felt the need for stereotypes.

What would be nice is if we could specify our own icon for a diagram. That would visually set them apart from the other diagrams.

Geert
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: qwerty on November 11, 2017, 10:56:28 pm
What would be nice is if we could specify our own icon for a diagram.

+1
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Paolo F Cantoni on November 13, 2017, 12:06:43 pm
What would be nice is if we could specify our own icon for a diagram.

+1
+1

Paolo
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Svend Erik Nygaard on November 15, 2017, 05:06:28 am
Why is it so important that you have a stereotype on your diagrams?

Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Geert Bellekens on November 15, 2017, 03:47:58 pm
Can't you do all of that without the stereotype as well?

Geert
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: qwerty on November 15, 2017, 08:12:11 pm
Yes, but it's inconvenient (due to inconsistency). You need to look after the "stereotype" of a diagram in StyleEx in the MDGDgm tag.

q.
Title: Re: MDG Custom Diagram - does not set diagram type or diagram stereotype?
Post by: Geert Bellekens on November 15, 2017, 10:38:38 pm
Yes, but it's inconvenient (due to inconsistency). You need to look after the "stereotype" of a diagram in StyleEx in the MDGDgm tag.

q.

No argue with that.

Geert