Author Topic: How to extend a non-UML metatype?  (Read 23297 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
How to extend a non-UML metatype?
« on: August 30, 2019, 02:59:08 pm »
I've tried to follow the somewhat ambiguous instructions in the Help.  These are the metatypes profile entries:


The toolbox entry is:
Test::Database(EAUML::Database)=MyDB

However, when I try to drag MyDB from the toolbox, I get:
"Missing base type 'Database' does not extend 'EAUML::Database'
Command: Test::Database(EAUML::Database)"

What am I doing wrong?

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13241
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to extend a non-UML metatype?
« Reply #1 on: August 30, 2019, 04:36:05 pm »
According to the help this should work, but I've had the same issue in the past.

It was solved by extending the base metatype (Package in this case?)

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #2 on: August 30, 2019, 05:02:28 pm »
According to the help this should work, but I've had the same issue in the past.

It was solved by extending the base metatype (Package in this case?)

Geert
Thanks, Geert,
Yes, I had a feeling that was so.  I tried Extending EAUML::Database to Package, but that didn't work.  Based on your input, I'll try extending [Edit2: Package to ] Test::Database.

[EDIT:  That didn't work either.  This is what the generated profile looks like.
Code: [Select]
<Stereotype name="Database" metatype="Database" notes="" cx="188" cy="80" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="EAUML::Database" baseStereotypes="EAUML::Database" redefines="EAUML::Database">
<AppliesTo>
<Apply type="Package">
<Property name="URI" value=""/>
</Apply>
</AppliesTo>
</Stereotype>
Any more ideas?]

Paolo
« Last Edit: August 31, 2019, 09:47:46 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13241
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to extend a non-UML metatype?
« Reply #3 on: August 30, 2019, 06:11:04 pm »
That's not exactly what I meant.
See this question on stackoverflow for what I mean: https://stackoverflow.com/questions/56537096/defining-a-stereotype-for-a-non-uml-element-in-a-sparx-enterprise-architect-uml

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #4 on: August 31, 2019, 09:56:47 am »
That's not exactly what I meant.
See this question on StackOverflow for what I mean: https://stackoverflow.com/questions/56537096/defining-a-stereotype-for-a-non-uml-element-in-a-sparx-enterprise-architect-uml

Geert
Sorry, Geert, I didn't explain what I was going to do properly.  I did as you suggested (edited my previous post).  (My) Database extends Package and Generalizes EAUML::Database.  I get the answer I posted.

I tried Adding the isActive attribute (to Package) but that didn't help.
Code: [Select]
<Stereotype name="Database" metatype="Database" notes="" cx="188" cy="80" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="EAUML::Database" baseStereotypes="EAUML::Database" redefines="EAUML::Database">
<AppliesTo>
<Apply type="Package">
<Property name="isActive" value=""/>
<Property name="URI" value=""/>
</Apply>
</AppliesTo>
</Stereotype>

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #5 on: August 31, 2019, 07:22:30 pm »
I remember Geert posting something similar these days where he also <<extends>> the metaclass on which EAUML:Database is built.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #6 on: September 01, 2019, 10:58:43 am »
I remember Geert posting something similar these days where he also <<extends>> the metaclass on which EAUML:Database is built.

q.
Oh, you mean extend BOTH?

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #7 on: September 01, 2019, 06:29:34 pm »
In your picture above draw an Extends towards <<metaclass>> <whatever> where <whatever> is that used for EAUML::Database (I'd guess Class).

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #8 on: September 02, 2019, 10:08:08 am »
In your picture above draw an Extends towards <<metaclass>> <whatever> where <whatever> is that used for EAUML::Database (I'd guess Class).

q.
I believe it's a Package.  This is the current model:


There is no change to the output profile from the one you see above.

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

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #9 on: September 03, 2019, 09:02:05 am »
I've tried to follow the somewhat ambiguous instructions in the Help.  These are the metatypes profile entries:


The toolbox entry is:
Test::Database(EAUML::Database)=MyDB

However, when I try to drag MyDB from the toolbox, I get:
"Missing base type 'Database' does not extend 'EAUML::Database'
Command: Test::Database(EAUML::Database)"

What am I doing wrong?

TIA,
Paolo

Database does not extend 'EAUML::Database', it (indirectly) extends 'UML::Package'. Try

Test::Database(UML::Package)=MyDB

or even

Test::Database=MyDB
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #10 on: September 03, 2019, 10:18:02 am »
I've tried to follow the somewhat ambiguous instructions in the Help.  These are the metatypes profile entries:


The toolbox entry is:
Test::Database(EAUML::Database)=MyDB

However, when I try to drag MyDB from the toolbox, I get:
"Missing base type 'Database' does not extend 'EAUML::Database'
Command: Test::Database(EAUML::Database)"

What am I doing wrong?

TIA,
Paolo

Database does not extend 'EAUML::Database', it (indirectly) extends 'UML::Package'. Try

Test::Database(UML::Package)=MyDB

or even

Test::Database=MyDB
Thanks Neil!

From previous (same) error messages in other toolbox contexts, I suspected it was a Toolbox profile problem, but as I've said before, still too new at this game.

Now Works! I get the «Test::Database» Package created from the toolbox!

Am I right in understanding that having extended (or NOT extended - as you indicate) EAUML::Database, I should be able to select my item and it will enable the Database Builder option on the context menu?

Semantically, if I haven't extended a non-UML metatype, but in fact, extended the base UML metatype, shouldn't Roy get to work fixing up the Help?   ;)

Finally, What I'm trying to achieve here is to allow us to have our own versions of standard Sparx EA MDG items - those that trigger specific functionality such as DB Modelling, BPMN, BPSim, DMN, etc.  Such that they preserve that functionality, but give us the option of rendering in a standard way for our environment.  Is this the mechanism to do that with?

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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8061
  • Karma: +118/-20
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #11 on: September 04, 2019, 10:21:06 am »
The two pages on extending a non uml type don't describe how that impacts creating a toolbox referencing your stereotypes. So I can see how you could make the mistake that you have. (Same for the stack overflow post)

There is a link to a page that has the information though.
Quote
In the 'Stereotype' field for this Toolbox item, type:
     Profile::Stereotype(UML::BaseUMLType)
     -  Profile is the name of the Profile that the Stereotype is defined in
     -  Stereotype is the name of the Stereotype/Metatype that this toolbox item will create
     -  BaseUMLType is the base UML type of the non-UML object
For example, to include a SysML Block in a Toolbox you would type:
     SysML1.3::Block(UML::Class)
...
All non-UML objects in Enterprise Architect are an extension of a UML Type. You can reveal an element's base UML type by deleting its Stereotypes. For example, create a SysML1.3 Block and then, using the Properties window, delete the Block element's Stereotype. The element type will change from Block to Class.

In short. All toolbox entries reference a qualified name. If that qualified name references a stereotype, you can optionally specify the UML class extension in parenthesis.

Specifying the extension is required if the stereotype directly or indirectly extends multiple UML types. (Otherwise you get some ugly icon and a menu when trying to create it)
Specifying the extension used to be required for extending non uml types because EA wasn't able to look up the extensions across profiles when creating the toolbox.
If you specify an extension that doesn't exist, you get the error message described in this this thread and stack overflow.

Help References

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #12 on: September 04, 2019, 10:44:38 am »
Thanks, Eve,

Can you comment on:
Quote
Finally, What I'm trying to achieve here is to allow us to have our own versions of standard Sparx EA MDG items - those that trigger specific functionality such as DB Modelling, BPMN, BPSim, DMN, etc.  Such that they preserve that functionality, but give us the option of rendering in a standard way for our environment.  Is this the mechanism to do that with?

Paolo

[Edit:  I'm still confused about extending - which would imply an «extension», whereas what the help refers to is actually Redefining (indeed one of the Help items talks about a «redefines» Generalization)  Should I change the post title?]
« Last Edit: September 04, 2019, 10:50:54 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8061
  • Karma: +118/-20
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #13 on: September 05, 2019, 01:26:42 pm »
'Extend' in the help topic title does not refer to an extension connector. It's the general verb.

The extension connector is always between a stereotype and a UML metaclass. It defines a UML metaclass the source stereotype can be applied to.
The generalization connector from a stereotype will always target another stereotype. This will result in the source stereotype inheriting any existing extensions.
The redefines connector is a generalization that defines additional behavior when that profile is in an active technology. (1. When an existing toolbox references the base stereotype it will actually create your stereotype, 2. Your tagged values show as if they were added the base stereotype instead of being a new stereotype)

All three connector types are a way of extending the target element.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to extend a non-UML metatype?
« Reply #14 on: September 05, 2019, 02:42:46 pm »
'Extend' in the help topic title does not refer to an extension connector. It's the general verb.
[SNIP]
All three connector types are a way of extending the target element.
Thanks, Eve,

that's clarified things.

(As before) Can you comment on:
Quote
Finally, What I'm trying to achieve here is to allow us to have our own versions of standard Sparx EA MDG items - those that trigger specific functionality such as DB Modelling, BPMN, BPSim, DMN, etc.  Such that they preserve that functionality, but give us the option of rendering in a standard way for our environment.  Is this the mechanism to do that with?

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