Author Topic: Diagram Properties in Stereotypes  (Read 378 times)

Jayson

  • EA User
  • **
  • Posts: 184
  • Karma: +1/-0
    • View Profile
Diagram Properties in Stereotypes
« on: October 15, 2019, 05:05:01 am »
Good morning (here anyway) all!  :)

I am trying to add a diagram property to one of my stereotypes within an MDG I am developing as described in at the bottom of the following page: https://www.sparxsystems.com.au/enterprise_architect_user_guide/14.0/modeling_tools/query_methods.html

Whilst it doesn't describe it very clearly, it appears that the method for doing this is to:

1. Create a new property under the Parts/Properties tab of the Features & Properties window.
2. Set the stereotype of this property to diagram property.

However, whenever I click add new and the Insert New Embedded Element pops up there are no options in the Type drop down box.
If I change the stereotype of the element to class (from stereotype) then I CAN select a type.

So I guess my questions are:

1. Have I interpreted how to define diagram properties correctly and if not, can you help me with this?
2. Why can't I select a Type?

Thanks in advance

Jays :-)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6953
  • Karma: +151/-111
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #1 on: October 15, 2019, 09:13:29 am »
Hi Jays,

If you could post the relevant portion of the generated MDG file, we can see what got generated.  I have some experience with diagram properties but I handcrafted them and I haven't used them with embedded items.  Still, seeing the generated code may help determine if there is a bug in the process.

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

Jayson

  • EA User
  • **
  • Posts: 184
  • Karma: +1/-0
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #2 on: October 15, 2019, 11:02:15 am »
Hey Paolo

Unfortunately there is no xml code because I can't even figure out how to select the Type in the Insert New Embedded Element dialog.
When I hit "OK" I get the error message "Please Select A Type for the New Element" however the Type drop down is not populated with any options.

Cheers :-)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6953
  • Karma: +151/-111
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #3 on: October 15, 2019, 02:29:21 pm »
Hey Paolo

Unfortunately, there is no XML code because I can't even figure out how to select the Type in the Insert New Embedded Element dialog.
When I hit "OK" I get the error message "Please Select A Type for the New Element" however the Type drop-down is not populated with any options.

Cheers :-)
Hi Jays,

I meant the MDG XML.  Find the appropriate stereotype and you should see something like:
Code: [Select]
<Stereotype name="@!" metatype="@!" notes="" cx="200" cy="100" bgcolor="-1" fontcolor="-1" bordercolor="49407" borderwidth="-1" hideicon="0" strictness="all" nature="Arc">
<AppliesTo>
<Apply type="Class">
<Property name="_UCRect" value="0"/>
<Property name="_defaultDiagramType" value="PrIME::Application"/>
</Apply>
</AppliesTo>
<TaggedValues/>
<DiagramProperties>
<!--Naming USDP-->
<DiagramProperty name="Name.Architecture" option="Nm.Archtctr" default="0"/>
<DiagramProperty name="Name.Normative" option="Nm.Nrmtv" default="0"/>
</DiagramProperties>
</Stereotype>
The    <DiagramProperties> section is what we're after.

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

Jayson

  • EA User
  • **
  • Posts: 184
  • Karma: +1/-0
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #4 on: October 16, 2019, 04:46:34 am »
Hey Paolo

My MDG xml file doesn't have any <DiagramProperty> tags cos I haven't managed to create any yet! :-(

However, I have uploaded the sandpit project I have been using here

https://www.dropbox.com/sh/ogfhb682oe8fzk1/AADV25iYKrpmBgPLcAi-ixmxa?dl=0

So you can better understand what I am trying to achieve, I want to:

1. Have all my stereotypes have a property called Impact that allows the Solution Architects to record what impact their solutions will have on a particular element.
2. The Impact property will have four possible values: Deprecated, Create, Modify or Re-Use.
3. When the Solution Architect is creating a solution, they will drag elements onto the page and set the Impact property accordingly.
4. I will then create shape scripts to colour the elements accordingly and also diagram filters to show Current and Future States from the same diagram.

The Impact property needs to be a diagram property rather than a regular old tagged value because the Impact on an element is specific to a particular solution, and the same element might be impacted differently on two different diagrams.

I hope this makes things clear!

Cheers :-)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6953
  • Karma: +151/-111
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #5 on: October 16, 2019, 09:00:47 am »
Hi Jays,

My Bad.  Personally, I would add handcrafted Diagram Properties to the MDG until it's sorted.  At least then you can get the Model and Shapescripts sorted.

We've adopted this process until the relevant sections of the new MDG mechanism are fixed and workable.

BTW, have you sent this to Sparx Support?  What did they say?

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

Jayson

  • EA User
  • **
  • Posts: 184
  • Karma: +1/-0
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #6 on: October 16, 2019, 09:47:22 am »
So, never EVER underestimate the power of human stupidity Paolo! (Mine I mean)

I found out SOME of what I was doing wrong and have managed to create a diagram property on one of my test stereotypes (called ExternalUser).
I have created a property called "IsRed" as per the example in the link I shared in the original post and it does the following:

1. It will display as a property when I right click on the element.
2. It displays with a "tick" next to the IsRed property and I can toggle between ticked and not ticked.


However, I am now at the point where I am wondering can I have the IsRed property allow me to select more than just tick or not? That is, can I offer my user a choice between Current, Future, Deprecated, Modified etc and then have the shape script respond to this choice?

Sorry for messing you around! I have included a link to the updated files below.

Cheers

Jays :-)

https://www.dropbox.com/sh/dtg65kk9flxoa4j/AADqZOOb9lHhHM_81MirQZuLa?dl=0

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6953
  • Karma: +151/-111
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #7 on: October 16, 2019, 10:22:30 am »
Hi Jays,

Been there, done that!  ;)

I would recommend that you look up my postings on "User Specific Diagram Properties"  (within last 999 days).  As you've appreciated, USDPs are a great idea, but (as usual) the implementation is less than optimal.  One thing that is really missing is the use of an enum against such a property.

You may get the answers you seek there, or at least it will allow you to frame any more questions against existing experience.

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

Jayson

  • EA User
  • **
  • Posts: 184
  • Karma: +1/-0
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #8 on: October 16, 2019, 10:35:18 am »
Okie dokie!

You mean this one:

https://sparxsystems.com/forums/smf/index.php?topic=30537.0

So Eve indicated that they are boolean only. Do you know if this has changed at all? Even if not using enum types then a simple list would be AWESOME!
If not I can work with it, just not as cool end user experience.

Thanks so much for your help, has made a HUGE difference.

Jays :-)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6953
  • Karma: +151/-111
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #9 on: October 16, 2019, 10:50:07 am »
Okie dokie!

You mean this one:

https://sparxsystems.com/forums/smf/index.php?topic=30537.0

So Eve indicated that they are boolean only. Do you know if this has changed at all? Even if not using enum types then a simple list would be AWESOME!
If not I can work with it, just not as cool end-user experience.

Thanks so much for your help, has made a HUGE difference.

Jays :-)
As far as I know, they're still just Boolean.  Not only is the user experience less than optimal, but you can't stop the user creating a set of self-contradictory settings.

Still, as always, we live in hope.  Perhaps a feature request from you will provide the impetus.

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

Jayson

  • EA User
  • **
  • Posts: 184
  • Karma: +1/-0
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #10 on: October 16, 2019, 12:00:43 pm »
Thanks Paolo! You have been wonderfully helpful.
I will ask Eve initially if things have changed and if not, will follow up with a feature request.

Cheers

Jays :-)

Jayson

  • EA User
  • **
  • Posts: 184
  • Karma: +1/-0
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #11 on: October 17, 2019, 05:20:15 am »
Hey Paolo

I noticed in one of your other posts that you asked if user diagram properties can be applied to connectors also.
Did you ever get an answer for that?

Cheers :-)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6953
  • Karma: +151/-111
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #12 on: October 17, 2019, 09:03:04 am »
Hey Paolo

I noticed in one of your other posts that you asked if user diagram properties can be applied to connectors also.
Did you ever get an answer for that?

Cheers :-)
AFAIK, NO :('

But maybe a Sparxian can verify.

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

Jayson

  • EA User
  • **
  • Posts: 184
  • Karma: +1/-0
    • View Profile
Re: Diagram Properties in Stereotypes
« Reply #13 on: October 17, 2019, 09:55:59 am »
Thanks Paolo.
I have emailed Sparx.