Author Topic: Is it possible to have multiple ocurrences in the same toolbox?  (Read 3592 times)

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
I have an MDG with a profile that includes the definition of a stereotyped element containing different tag values.

Is it possible in a Toolbox profile to have one toolbox item that allows me to add the element to a diagram with all its tag values empty, but also have another toolbox item that allows me to add the same type of element but with some tag value set (not empty)? And a 3rd toolbox item that add the same type of element with the same tag value with another 3rd default value? is that possible?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Is it possible to have multiple ocurrences in the same toolbox?
« Reply #1 on: May 24, 2023, 07:24:08 am »
IIRC BPMN offers elements that when dragged open a context menu to drop different variants. That's probably the way you have to do it too.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is it possible to have multiple ocurrences in the same toolbox?
« Reply #2 on: May 24, 2023, 10:11:43 am »
IIRC BPMN offers elements that, when dragged, open a context menu to drop different variants.  That's probably the way you have to do it too.

q.
As q says, the BPMN items use the "Hidden Menus" mechanism to achieve this.  Let us all know if you work out how to do it without using the "Hidden Menus" mechanism.

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

philchudley

  • EA User
  • **
  • Posts: 736
  • Karma: +20/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: Is it possible to have multiple ocurrences in the same toolbox?
« Reply #3 on: May 24, 2023, 06:34:00 pm »
The method to display the menu for a tagged value as per BPMN (assuming the ID if the MDG is MYMDG)

1) Define an enumeration containing the literals for the tagged value
2) Add an enumeration tagged value to the stereotype (lets say MyStereotype), for example MyTaggedValue
3) In the metaclass for the stereotype add an attribute named _subTypeProperty of type String
4) Set the initial value of this attribute to the fully qualified MDG name of the tagged value (as defined in 2) above. In this example this would be

MYMDG::MyStereotype::MyTaggedValue

Hope this helps

Phil

follow me on Twitter

@SparxEAGuru

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1352
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Is it possible to have multiple ocurrences in the same toolbox?
« Reply #4 on: May 24, 2023, 10:20:23 pm »
Using _subTypeProperty as suggested by Phil is great as it displays a popup when creating a stereotyped element to select the value for a given enum tagged value.

As an alternative and to support a combination of custom default values for a set of tagged values, you can use Patterns and expose them in your toolbox.
- Using a project where the MDG is installed, create a diagram with a stereotyped element and update the tagged values as per your default choice for a toolbox e.g. tag1 = val1, tag2 = <null>
- Save this diagram as a UML Pattern; the generated XML file will need to be included in your MDG
- In the toolbox profile, create an attribute named "MDGName::MyPattern1(UMLPatternSilent)"
Guillaume

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


Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Re: Is it possible to have multiple ocurrences in the same toolbox?
« Reply #5 on: June 01, 2023, 06:15:01 am »
The method to display the menu for a tagged value as per BPMN (assuming the ID if the MDG is MYMDG)

1) Define an enumeration containing the literals for the tagged value
2) Add an enumeration tagged value to the stereotype (lets say MyStereotype), for example MyTaggedValue
3) In the metaclass for the stereotype add an attribute named _subTypeProperty of type String
4) Set the initial value of this attribute to the fully qualified MDG name of the tagged value (as defined in 2) above. In this example this would be

MYMDG::MyStereotype::MyTaggedValue

Hope this helps

Phil

This was the option that worked for me, thanks @Phil

Just some precision: the name of the tag value should be _subtypeProperty (avoid capital T) and the value is not MYMDG::MyStereotype::MyTaggedValue but MYProfile::MyStereotype::MyTaggedValue