Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Paolo F Cantoni on July 27, 2020, 09:12:53 pm

Title: Weird <Apply type> behaviour
Post by: Paolo F Cantoni on July 27, 2020, 09:12:53 pm
We have a metatype "Grouping" (which behaves a bit like an Archimate Grouping).  The handcrafted definition has the Apply type="Component".  It also inherits from a higher level abstract metatype whose Apply type="Class".

Should that be an issue?

In any event with that definition, it would not drag from the toolbox any more.  It would "silently fail".

In trying to diagnose the problem, I dragged on another item and tried to reset the stereotype.  I was able to do this, but noticed that the Stereotype assignment dialog said the Apply type for Grouping was "Class" only.  Not "Component" nor even "Component, Class".   Note: the item was a class based metatype - so I suspect that's why.

Anyway, changing the Apply type to Apply type="Class" allowed the item to be dragged from the Toolbox.

Can anyone explain why and what was wrong with the original definition?

As an aside, could I create an abstract metatype WITHOUT an Apply type= section?  So I could pass on the other aspects of the abstract metatype, but not impede the specialized metatype?

TIA,
Paolo
Title: Re: Weird <Apply type> behaviour
Post by: qwerty on July 27, 2020, 09:17:16 pm
I can't contribute. I almost never use the Apply since it does not override but add the stereotype (and you don't have a choice which would be easy to implement with another choice in the drop down). Adding a stereotype in my case is not what is wanted.

q.
Title: Re: Weird <Apply type> behaviour
Post by: Eve on July 28, 2020, 10:38:08 am
What form is your toolbox specifying the item?

It should work if you fully specify it. ie. MyProfile::Grouping(UML::Component). If you only specify the stereotype but not the applies it doesn't know which extension to use.

When you extend Class on the specialized type instead, it still only extends class and the settings within that extension override the base one.

I would always create an abstract stereotype without an extension when I plan to specialize it from stereotypes that extend different metatypes.
Title: Re: Weird <Apply type> behaviour
Post by: Paolo F Cantoni on July 28, 2020, 10:57:28 am
What form is your toolbox specifying the item?

It should work if you fully specify it. ie. MyProfile::Grouping(UML::Component). If you only specify the stereotype but not the applies it doesn't know which extension to use.

When you extend Class on the specialized type instead, it still only extends class and the settings within that extension override the base one.

I would always create an abstract stereotype without an extension when I plan to specialize it from stereotypes that extend different metatypes.
(my emphasis)
Thanks, Eve,

Yes, that's the conclusion I came to (about the abstract metatypes).  I'll check the specifics of the specification (pun unavoidable  ;)).

Paolo