Author Topic: MDG Diagram Type Groups  (Read 5582 times)

workingmatt

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
MDG Diagram Type Groups
« on: October 04, 2022, 07:19:14 am »
I'm creating an MDG technology. I have lots of diagram types that I would like to group when they appear in the New Diagram dialogue.

You can see the effect I'm looking for in this diagram where five diagram types are grouped into Class.



TIA

workingmatt

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram Type Groups
« Reply #1 on: October 04, 2022, 07:22:11 am »
The Insert Image didn't work... have a look at https://postimg.cc/FY5kX2qV or read the following.

You can see what I'm after if you right-click on a package and select Add Diagram...
In the type pane select UML Structural from the dropdown, select UML Structural in Select From:, expand Class to show five grouped diagram types. This is what I want to achieve rather than a flat list of diagram types.
 

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile

workingmatt

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram Type Groups
« Reply #3 on: November 10, 2022, 05:34:48 am »
Thanks for the link Eve.

I'm having huge difficulty following the process. There are missed steps and confusing differences to the 'normal' way of creating a working MDG. I've tried working through the instructions a few times. Perhaps you could answer a couple of questions to help me.

In addition to starting from scratch, I also tried starting with a working MDG with <<profile>>MyMDG, <<diagram profile>>MyMDG and <<toolbox profile>>MyMDG packages. Each of those have a class diagram within them. Which diagram should I create the View Specification on: profile, diagram or toolbox?

When extending a UML Diagram type (row 4), there is no Class icon in the toolbox - should I use a Metaclass as suggested in the diagram in that row? When naming the metaclass should it be Component or Diagram_Component as usual? There's a missing step but I'm assuming you have an Extension relationship between the View Specification and Metaclass. I've not seen any effect in the results, I assume that you need to generate the MDG as usual to see anything, but I cannot even see MyMDG perspective in the Add Diagram window let alone the new MyView::Component.

I've gone through later steps, but would like to get the above working before trying those again.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: MDG Diagram Type Groups
« Reply #4 on: November 10, 2022, 08:36:57 am »
A view specification is created in the profile.

If you want to extend a component diagram you use a metaclass with the name Component. That's literally the example it gives.

workingmatt

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram Type Groups
« Reply #5 on: November 10, 2022, 10:33:49 pm »
I've had some success, although I personally struggled to follow the instructions. Here's what I've found that helped me and hopefully others in the future.

1. I started with an MDG Builder that used the 'old' way of having a <<profile>>, <<diagram profile>>, and <<toolbox profile>> folder and checked that worked.
2. I added a extra new <<profile>> package called MyViews
3. For each new diagram type you must create a separate diagram each with a <<View Specification>> extending a metaclass named, literally, as shown in the example (the core diagram's type or the fully qualified stereotype from another profile). You must also expose some elements/relationships for it to work to my understanding.
4. Publish the new <<profile>>MyViews package as a profile
5. Generate the MDG as usual with the 'old' MDG adding the extra Views profile just created at the profile file selection stage.

?GetCurrentDiagram().MetaType does not work in the javascript console I had the diagram open in the main pane. I ended up using a script instead before finding out ?GetTreeSelectedObject().MetaType works (obviously select the digram in the browser). Helpfully ?GetTreeSelectedObject().Type gives the correct name to use for core UML diagram types e.g. Use Case not UseCase which bit me for a short time.

I still need to work out the following:

a) The new views are nested under the diagram types in their original perspectives. In the Create Diagram dialog a View Specification extending a Logical metaclass appears under UML Structural Class 'folder' and extending a GRA UML Component appears under GRA UML Component 'folder'. I'd like to create my own nested diagrams under my specialized MDG perspective. I tried extending one of the views I created in this process (MyViewProfile::MyViewLogical), and tried extending an 'old style' MDG diagram (myMDG::MyClassDiagram) but these didn't produce any diagram types anywhere. The only diagram types listed under myMDG are the ones created in the <<diagram profile>>. This is my original question - any suggestions?

b) The exposed elements/relationships appear in different pages of the toolbox, some on a core element page, others on the new type's page. Any suggestions for how to fix this gratefully received.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: MDG Diagram Type Groups
« Reply #6 on: November 10, 2022, 10:47:45 pm »
I think I once also tried this and gave up. EA. If you fought the windmills successfully let us know.

q.

workingmatt

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram Type Groups
« Reply #7 on: November 11, 2022, 05:57:18 am »
I know it's possible because I've seen it here: https://www.youtube.com/watch?v=385d7bv7GUE&list=PLjLDdg6u4qvpHEplsibm1RVbOTE1yfeOD&index=1&t=1590s

Timings: Setup shown at about 29:44 and grouped diagrams used about 48:52
« Last Edit: November 11, 2022, 06:00:00 am by workingmatt »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: MDG Diagram Type Groups
« Reply #8 on: November 11, 2022, 07:06:35 am »
Thanks for the pointers. I might give that a try tomorrow. (Not a promise, though)

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: MDG Diagram Type Groups
« Reply #9 on: November 13, 2022, 09:38:35 am »
I'm sitting on this right now. A real PITA. The "documentation" just starts wrong when telling
Quote
Expand the 'Metamodel' page in the Toolbox and note the:

'View Specification' element, which you can use to create a custom diagram View
Simply no. There is no such element. I have to create it manually by stereotyping a class. Then it goes on with "click here" and "drag there" without explaining what the effects are and why it should be done or how things are related. If they simply would publish an example it would probably be a piece of cake (not a tasty one, though).

(Well, I still remember the times when it was fun to work with EA and Sparx but since many years both got worse and today it's mostly banging my head against the wall.)

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: MDG Diagram Type Groups
« Reply #10 on: November 14, 2022, 03:24:34 am »
I gave up for the moment. We might be lucky that Phil (the author of the video) comes upon reading this post. He's usually very responsive and helpful. Maybe he can trigger the right points to get us up and running.

q.

philchudley

  • EA User
  • **
  • Posts: 744
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: MDG Diagram Type Groups
« Reply #11 on: November 14, 2022, 08:25:02 pm »
Hi

I created the video referred to in a previous post, as I am busy all day today with a client, I will reply in detail tomorrow on how to create a ViewSpecification which models a viewpoint with a filtered toolbox.

All the best

Phil
Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: MDG Diagram Type Groups
« Reply #12 on: November 14, 2022, 09:27:55 pm »
I was pretty sure (about both of your statements) :-) No hurry. Just when you got time.

q.

workingmatt

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram Type Groups
« Reply #13 on: November 15, 2022, 04:50:45 am »
I've solved my problems with this. The main sticking point seems to be that I had a separate <<profile>> folder for view specifications as mentioned in the documentation. Moving them to the main <<profile>> folder made it work.

Here are the steps to creating sub-diagram types aka view specifications.
1) Have a working MDG with profile, toolboxes and diagram type defined. My simple "MyMDG" test defined MyClassDiagram, MyClass, MyObject, MyAssociation, MyGeneralization, MyInstantiation.
2) Add a new Class diagram(s) to the <<profile>> folder called View-MyClassesOnly
3) Drag on MyMDG::MyClassDiagram from <<diagram profile>> folder onto this new diagram as a link
4) Create a new View Specification from the Metamodel page of the MDG Technology Builder -> Profile toolbox. I named this Classes Only.
5) Drag on MyClass, MyObject and the three relationships I defined earlier.
6) Create an expose relationship from the <<View Specification>> to the elements/relationships you want to show in this sub-diagram.
7) Copy this diagram and call it View-MyObjectsOnly and expose a different subset of elements/relationships.
8) Publish the <<profile>> package as a profile as usual
9) Generate the MDG as usual
10) Create a new diagram, navigate to MyMDG and feast your eyes on a nested set of diagram types! I can now choose to create a MyClassDiagram with all elements and relationships, or a MyClassesOnly or MyObjectsOnly with a subset of elements/relationships otherwise available to a full MyClassDiagram (my names could be better).
https://i.postimg.cc/9QPgsN94/mdg-view-specification.png

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: MDG Diagram Type Groups
« Reply #14 on: November 15, 2022, 05:30:34 am »
Great :-) I'll try that tomorrow!

q.