Author Topic: How to override UCInclude Shapescript?  (Read 5089 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8596
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
How to override UCInclude Shapescript?
« on: February 15, 2024, 03:59:32 pm »
In https://sparxsystems.com/forums/smf/index.php/topic,48253.0.html, Sparxian Eve clarified how to add a Use Case Include relationship to our MDG toolbox (i.e. UML::UCInclude).  We'd now like to override the UCInclude shapescript.  So, we tried to create our own stereotype in our MDG by extending «metaclass» Include.  Thus «Stereotype» OurStereotype «extends» «metaclass» Include.
OurStereotype includes a shapescript definition in the _image attribute.
However, this doesn't work.  When we create the realtionship, it has the (extended) stereotype property OurMDG::OurStereotype, include.  t_connector.Stereotype=OurStereotype,  t_connector.Connector_Type=UseCase,  t_connector.Subtype=Includes  - so it looks like we'd expect, but the OurStereotype shapescript is NOT invoked! It appears the original UML::UCInclude shapescript is invoked.

Can some kind soul indicate what we're doing wrong?  So that our shapescript is invoked.

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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8596
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to override UCInclude Shapescript?
« Reply #1 on: February 16, 2024, 11:51:01 am »
Some more weirdness...  As I mentioned previously, when we create the relationship, it has the (extended) stereotype property "OurMDG::OurStereotype, include".  When we open the Stereotype compartment of the Properties window -  we see:
OurMDG::OurStereotype
include


(in the two expected cells) and the Type cell shows:
Use Case «include»
as expected.
However, when we open the stereotype cell, instead of seeing a dialog with
Perspective: User Technologies
Profile: OurMDG
Stereotypes: OurStereotypeApply to: Include (or even UCInclude)
We find NO stereotypes listed!
Only when we change the Profile from OurMDG to <none> do we find...

Perspective:  User Technologies
Profile: <none>
Stereotypes: OurMDG::OurStereotype Apply to: <empty>

When this happens, it's often because OurMDG::OurStereotype has been created in the local stereotype list and needs to be removed.  But this is NOT the case here!

[Edit: Also, since the designation of  Use Case «include» is UML::UCInclude;  t_xref.Description instead of holding:
@STEREO;Name=OurStereotype ;FQName=OurMDG::OurStereotype ;@ENDSTEREO;@STEREO;Name=UCInclude;FQName= UML::UCInclude;@ENDSTEREO;
Holds:
@STEREO;Name=OurStereotype ;FQName=OurMDG::OurStereotype ;@ENDSTEREO;@STEREO;Name=include;GUID={A61EC366-2FF9-40da-9AED-1CB578D3B45A};@ENDSTEREO;
i.e. it's created a local stereotype!]

It's beginning to smell like legacy hard coding that makes UCInclude inconsistent with the current MDG mechanisms.  Can anyone shed any light?

TIA,
Paolo

« Last Edit: February 16, 2024, 12:27:46 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8596
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to override UCInclude Shapescript?
« Reply #2 on: February 19, 2024, 11:32:31 am »
Some further testing reinforces it is some kind of hard coding.  If we change the base connector type to just about anything other than UseCase  (we settled on Connector - after confirming several different values did work), then the override works correctly!  :(

Please rectify.
Reported,


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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8596
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to override UCInclude Shapescript? - Resolved
« Reply #3 on: February 23, 2024, 05:53:38 pm »
I sent a support request to Sparx, and they replied:

"The answer appears to be to have a second Extension to a metaclass element "UseCase", which is the value that appears in the t_connector.Connector_Type field in the database."

To which I replied:
"Two points:

1) UseCase is an Element metaclass, not a Connector metaclass
2) How are we poor sods supposed to guess this is the solution?  Is the documentation going to be updated?"

Still, at least we got a working answer!

HTH,
Paolo
« Last Edit: February 23, 2024, 05:57:24 pm by Paolo F Cantoni »
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 override UCInclude Shapescript?
« Reply #4 on: February 23, 2024, 09:06:54 pm »
Business as usual.

q.