Author Topic: MDG Diagram derivation  (Read 4530 times)

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
MDG Diagram derivation
« on: January 30, 2020, 04:37:13 am »
After a long time I'm back to EA and want to create an own MDG. There I have huge problems with creating own diagrams:

1. I tried to derive a diagram from a SysML1.4 diagram (SysML1.4::Sequence). In my diagram profile diagram I added a stereotype with name "SysML1.4::Sequence", another stereotype with my diagram name and an extension connector. In the base stereotype (SysML1.4::Sequence) i set the properties alias and toolbox (with an own toolbox in my MDG). When I (after creating and importing the MDG) want to add the diagram to a package, I can see the diagram in the selection dialog, but it doesn't have the icon of the SysML diagram but a class diagram icon. When I create the diagram, an empty diagram canvas is shown without any SysML frame and no metaclass.
I also tried  to change the base stereotype into a metaclass, with the same result except that the metaclass of the crated (derived) diagram is my derived diagram class itself.

2. So I changed the way to do it and derived my diagram from Diagram_Sequence metaclass. Now the icon was right, but the diagram itself still has no frame (diagramID set to 'sd', frameString set to '#DGMNAME#').

So my question(s): How can I derive a diagram from SysML1.4::Sequence or, if that isn't possible, how can I show the SysML frame around my diagram derived from 'Diagram_Sequence'?

Any help will be welcome!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: MDG Diagram derivation
« Reply #1 on: January 30, 2020, 05:20:27 am »
IIRC the toolbox is not inherited. You need to create it from scratch for you diagram. But you can add the tools the same way as you see in the origin plus your own. Or only a subset. It seems V15.1 has some improvements here, but I haven't looked into that.

No idea about the 2nd part. Creating MDGs in EA is a game of good guessing.

q.
« Last Edit: January 30, 2020, 12:28:56 pm by qwerty »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: MDG Diagram derivation
« Reply #2 on: January 30, 2020, 09:43:12 am »
In order to extend a SysML diagram and still have it behave like a SysML diagram, you will need to define a view. See the help page here: Custom Metamodel Diagram View
The Sparx Team
[email protected]

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram derivation
« Reply #3 on: January 30, 2020, 09:03:17 pm »
@qwerty: Sorry, but I don't understand your answer. I don't have any problems with the toolbox but with deriving diagrams in MDGs. Maybe you can explain.

@KP: I stumbled over these Cunstom Metamodel Diagram View before but it seemed not to be that what I wanted. Following your hint I created the view and unfortunaltely it was as expected: I have a new diagram derived from the SysML diagram, but it is located in the SysML technology branch of the diagram selection dialog.

What I want to achieve for the first is to create a technology which is a subset of SysML, containing several SysML diagrams and toolboxes with reduced content. I want the diagrams to appear in the branch of my technology in the diagram selection dialog, having the names I gave them ant attached to the toolboxes I created.
I have no problem creating the toolboxes containing SysML elements, but currently I see no way to derive a diagram not from a UML metaclass but from a SysML stereotype.

I am willing to create an own diagram, looking like a SysML diagram, but I cannot achieve that a SysML-like frame is drawed in the diagram, behaving like the frames in the SysML diagrams, which means showing the type and name of the diagram on the top border of the frame and resizing automatically to incluse all elements in the diagram. I not even can achieve to get any frame drawn in the diagram, although in the https://www.sparxsystems.com/enterprise_architect_user_guide/15.1/modeling/create_diagram_profiles_using_.html article there are mentioned properties like 'Frame ID' and 'Frame Format', which makes me believe tha there should be a frame visible in the diagram.

I still hope that there is some specialist who is able to help me to reach my goal.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: MDG Diagram derivation
« Reply #4 on: January 30, 2020, 10:19:39 pm »
Sorry, I didn't get the point originally. Just disregard what I wrote. Go for the solution that KP suggested.

q.

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram derivation
« Reply #5 on: January 31, 2020, 10:19:17 pm »
I tried it, but as described above, it is not what I need.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8052
  • Karma: +118/-20
    • View Profile
Re: MDG Diagram derivation
« Reply #6 on: February 03, 2020, 10:08:53 am »
It may not give you the UI you want in the new diagram dialog, but it is the only way to create the functionality you need.

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram derivation
« Reply #7 on: February 03, 2020, 09:50:23 pm »
Yeah, and that's what I suspected. And it is the customer, who wants that UI functionality. It is not our way of working to tell the customer he has to take what we give him or leave it.

What I don't understand is why I can derive from element stereotypes but not from diagram stereotypes. I would appreciate if that will be implemented in future versions of EA.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8052
  • Karma: +118/-20
    • View Profile
Re: MDG Diagram derivation
« Reply #8 on: February 04, 2020, 10:30:23 am »
I'd love to help you, and your customer. At the moment the functionality just isn't there. I'm not going to offer you promises of functions that may not happen, but I will try to help you make things work.

Diagram types may be defined by a profile, but EA sees them as flat types. It doesn't have any handling for inheritance of behavior etc. There are specific behaviors implemented for SysML diagrams that you can't get unless the type is exactly right. The view mechanism allows you to modify the elements available and still preserve that behavior. It's not just you facing that limitation, the built-in UAF technology also defines its diagram types as views for SysML. (Which happens to be what the specification specifies)

Would an add-in that contains menu items for creating your new diagram work for you?

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: MDG Diagram derivation
« Reply #9 on: February 04, 2020, 09:40:16 pm »
Dear Eve, I appreciate your help and I didn't want to upset you.
For now I will derive from builtin diagrams and provide a frame element to the user in the toolbox. It's not as comfortable as in the SysML diagram but it will do for now.

Would an add-in that contains menu items for creating your new diagram work for you?
Basically I know how to prorgram add-ins for EA, but I don't know what you mean here exactly. When I create an add-in, its menu only appears in the 'Specialize' section of the popup menu. Is there a way to create own menu entries e.g under the 'Add Diagram ...' entry in the Project Browser popup menu?

Another question which rose up while working on that MDG is how I could program such a behaviour like in the SysML diagrams by myself, meaning to paint a frame which is not a diagram element and which will resize automatically. I didn't find any drawing commands in the add-in API. Of course I could automatically add an frame element to each newly created diagram but this would be even this - a diagram element which can be edited or deleted by the user.
Maybe you can give me a hint whether and how this can be achieved.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8052
  • Karma: +118/-20
    • View Profile
Re: MDG Diagram derivation
« Reply #10 on: February 05, 2020, 09:39:57 am »
When I create an add-in, its menu only appears in the 'Specialize' section of the popup menu. Is there a way to create own menu entries e.g under the 'Add Diagram ...' entry in the Project Browser popup menu?
I was just suggesting that having your own Add Diagram menu item with all of your types in the specialize menu may help your end user to find them.

Another question which rose up while working on that MDG is how I could program such a behaviour like in the SysML diagrams by myself, meaning to paint a frame which is not a diagram element and which will resize automatically. I didn't find any drawing commands in the add-in API. Of course I could automatically add an frame element to each newly created diagram but this would be even this - a diagram element which can be edited or deleted by the user.
Maybe you can give me a hint whether and how this can be achieved.
You won't be able to reproduce most of the SysML specific behavior with another diagram type. That's why you need to use a view on top of the existing SysML diagrams.