Author Topic: Shape script selection criteria?  (Read 3104 times)

nik_se

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Shape script selection criteria?
« on: October 22, 2021, 05:39:54 pm »
Hello,

does anyone know how shape scripts are selected in case an element has multiple stereotypes?

I have learned that only one shape script will be executed in case an element has multiple stereotypes, but I have not found any documentation or posts that explain what criteria EA uses to determine which shape script to use if there are multiple.

I know many of you will recommend to use only one stereotype, but the scenario we are looking at is to be able to use multiple MDG technologies at the same time and make the diagram notation to automatically adjust depending on the diagram type.
As an example, we have users that are using BPMN2 and/or Data Flow Diagram MDGs, but we also have a common, custom made MDG to support the full Enterprise Architecture modelling. In all of these three MDGs there is a Process stereotype that we would like to be able to set on the same element to be able to model it completely according to all three meta models. The actual modelling with multiple stereotypes works fine, but the diagrams look crazy as we have not figured out how to control the shape script selection. 

Anyone that knows how to resolve this or have ideas on alternative approaches?

qwerty

  • EA Guru
  • *****
  • Posts: 12446
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Shape script selection criteria?
« Reply #1 on: October 22, 2021, 06:39:59 pm »
This has been asked (by Paolo IIRC) but I can't recall the answer (from Eve?). I'm dealing with "there is no order" as I always did.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11314
  • Karma: +422/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shape script selection criteria?
« Reply #2 on: October 22, 2021, 06:55:43 pm »
The conclusion was that it really only works with a single stereotype.

I think you better find an approach with single stereotypes. You can still use a shapescript that changes the appearance depending on the type of diagram (I think), or some other diagram specific property that the user can select (similar to rectangle format)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 12446
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Shape script selection criteria?
« Reply #3 on: October 22, 2021, 07:06:45 pm »
Sometimes you can experiment. I do have a stereotype TBD which formerly performed a shape script to make the background yellow. That worked for some time until I had to assign the color via a diagrammatic export. But if you are trying to combine complex things that will fail for sure.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8001
  • Karma: +211/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shape script selection criteria?
« Reply #4 on: October 23, 2021, 08:06:33 pm »
Hi Nik?,

We have experimented with something similar to what you are attempting - that is to have the same object appear in various forms depending on which modelling technology is being used.  However, we've used a different approach.  So far it's worked, but we've only tried a couple of technologies.  It also requires multiple stereotypes, but in the reverse mode to that way in which you are thinking about and a bit of work on our part.

If you're interested, let me know and I'll expand more on how we do it.

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

nik_se

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Shape script selection criteria?
« Reply #5 on: November 02, 2021, 02:07:37 am »
Thanks guys for all replies.
I'm interested to know a bit more on your approach Paolo, could you explain in more detail?

//Niklas

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8001
  • Karma: +211/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shape script selection criteria?
« Reply #6 on: November 02, 2021, 12:11:07 pm »
Thanks guys for all replies.
I'm interested to know a bit more about your approach Paolo, could you explain in more detail?

//Niklas
Hi Niklas,
In order for the approach to work, you need to
  • Be prepared to create your own MDG defining each item in your methodology
  • Create shapescripts for those items that can react to User Defined Selection Properties (USDPs)

The end-user experience is stilted, and to an extent confusing, but it does work.  Also, this is a lot of work (especially starting from scratch), but the results are pretty good and you can use standard patterns in the code for the vertices to make it easier to manage.  In our case, we already had our own MDG with appropriate shapescripts which we were able to modify in a consistent way.  Are you willing to undertake this work?


If not, then there's no point in going deeper.


Paolo


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

nik_se

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Shape script selection criteria?
« Reply #7 on: November 02, 2021, 08:31:31 pm »
Hi Paolo,

many thanks for your reply.

We have an MDG with shape scripts for all stereotypes in our profile (about 30 stereotypes and 50 relationship types). Basically what we do is draw the UML native shape and then add an Archimate symbol in the top left corner if the stereotype also exist in Archimate.

We have also defined some diagram types that use different toolboxes depending on the elements & relations that are expected to be used in that particular diagram type.

However, we have not defined stereotypes to match all those in other MDGs. For example, we have a set of stereotypes that correspond to a subset of Archimate stereotypes, but not all of them. If possible, I would like to avoid re-defining all stereotypes from other technologies in our own MDG.

//Niklas


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8001
  • Karma: +211/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shape script selection criteria?
« Reply #8 on: November 02, 2021, 09:45:30 pm »

[SNIP]

However, we have not defined stereotypes to match all those in other MDGs. For example, we have a set of stereotypes that correspond to a subset of Archimate stereotypes, but not all of them. If possible, I would like to avoid re-defining all stereotypes from other technologies in our own MDG.

//Niklas
Hi Niklas (Good name - my eldest son's :) )
Looks like you have all the skills necessary.  It's probable that we've just been at it longer than you.  We add stereotypes/metatypes to the MDG as we need.  We also add the Additional Shaping and Naming capabilities as required.  We can also control which "widgets" are exposed on a particular diagram  (we have to keep things very simple for executives ;) ).


Depending on the metatype, we have a standard set of shapes to switch to, ellipses, rectangles, cornered etc. etc.  We also allow the user to select the standard MDG shapes in sometimes one or more standards.  Lastly, we've added the ability to select from a set of names for the item which are stored as properties of the item.  All of the selections are made via User Specified Diagram Properties USDPs.


As I mentioned in another thread, we simulate the inheritance of USDPs (<diagram property>) because the inheritance doesn't yet work for them.


So for example, the same item on different diagrams can use the normative name, the common name, an ad hoc name or an alias.  It can be a triangle, a rectangular (native) shape, the ArchiMate shape, our own MDG shape.


If you (or others) have any specific questions, just ask.


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

nik_se

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Shape script selection criteria?
« Reply #9 on: November 04, 2021, 06:32:20 pm »
Thanks for the clarification Paolo.
So, if i understand it correctly, you assign each of the elements in your models a single stereotype (from your profile). Then your shape script evaluates the diagram properties and draws a different shape depending on how these are set?

//Niklas

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8001
  • Karma: +211/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shape script selection criteria?
« Reply #10 on: November 04, 2021, 07:47:43 pm »
Thanks for the clarification Paolo.
So, if i understand it correctly, you assign each of the elements in your models a single stereotype (from your profile). Then your shape script evaluates the diagram properties and draws a different shape depending on how these are set?

//Niklas
Yes.Niklas, that's correct.  In addition to simple shapes, as I mentioned, we can draw shapes from more than one methodology, again, by selection.


As you mentioned, each item has a single, definitive, stereotype.  However, For example with database tables (DBTbl in our methodology), we also add the EAUML::table stereotype as a secondary.  That way, a DBTbl can participate correctly in all the capabilities of the Database modelling profile (since it is still seen by the Database Builder as an EAUML::table) but allows us to alter its shape as desired.  In normal circumstances, the DBtbl looks just like a standard EAUML::table.


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