Book a Demo

Author Topic: Can I create from the toolbox an element with a custom tagged value?  (Read 4891 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Hi,

I got an interesting request from a client. We have a stereotyped class with an enum tagged value "Type" (A/B/C) defined in the MDG.
By default an element is created with Type = A
They asked if we could define the toolbox so the stereotyped class can be created with other values e.g.
MyClass - Type A -> "MyClass" new element with tag type = A
MyClass - Type B -> "MyClass" new element with tag type = B
MyClass - Type C -> "MyClass" new element with tag type = C, etc.

If I put MyClass stereotype in the toolbox, it can only be created with the default type = A.

Is there a way in the toolbox profile to say that a stereotype element must be created with a different tagged value?
« Last Edit: September 18, 2020, 05:35:39 pm by Guillaume »
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Can I create from the toolbox an element with a custom tagged value?
« Reply #1 on: September 18, 2020, 05:27:37 pm »
Were you cut off? Seems there's a piece of your post missing.
/Uffe
My theories are always correct, just apply them to the right reality.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Can I create from the toolbox an element with a custom tagged value?
« Reply #2 on: September 18, 2020, 05:48:44 pm »
If what I asked earlier is not possible, I found a workaround in the BPMN profile with Gateways.
When you create a gateway from the toolbox, you get to choose the type (Exclusive, Inclusive, etc.) -> it creates Geteway stereotyped elements with a different value for the tag Type.

Is there any doc that explains how to do that in a custom MDG?

« Last Edit: September 18, 2020, 05:51:39 pm by Guillaume »
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can I create from the toolbox an element with a custom tagged value?
« Reply #3 on: September 18, 2020, 05:54:41 pm »
I think there was something where you could set a tag that somehow defines the subtype, but I'm not sure.

Have you tried to figure it out based on the BPMN mdg xml?

Geert

(it is also possible that this behavior has been hardcoded into EA)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Can I create from the toolbox an element with a custom tagged value?
« Reply #4 on: September 18, 2020, 06:49:34 pm »
Or you have an add-in that reacts upon creation of a new element.

q.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Can I create from the toolbox an element with a custom tagged value?
« Reply #5 on: September 18, 2020, 07:20:53 pm »
I found the _subtypeProperty custom attribute in the BPMN2 MDG.
It's documented here: https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/supportedattributes_2.html

I works really well ; I simply had to create the _subtypeProperty attribute in the Class metaclass and set the value type MyProfile::MyClass::Type

Thanks for your help!

I found one issue however. I need to use it also on stereotyped ports. However even though this is properly set in the MDG file:

<Apply type="Port">
<Property name="_subtypeProperty" value="MyProfile::MyPort::Type"/>
</Apply>

This drop down list is not shown when I want to create the port.
« Last Edit: September 18, 2020, 07:51:15 pm by Guillaume »
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


adepreter

  • EA User
  • **
  • Posts: 190
  • Karma: +10/-10
    • View Profile
Re: Can I create from the toolbox an element with a custom tagged value?
« Reply #6 on: September 23, 2020, 07:02:44 pm »
In Labnaf you can also automatically calculate the value of any tag when the element is created. Calculations can be also performed periodically.
https://www.labnaf.one/guidance/index.html?guid=42F6CE55-8165-474d-A50F-ACEFF6DAD1D3


Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Can I create from the toolbox an element with a custom tagged value?
« Reply #7 on: September 23, 2020, 07:28:45 pm »
Bonjour Alain,

That's interesting.
My guess is that you use the EA Broadcast events to update the tagged value for a new element via an addin or script ; am I correct?

Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com