Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: mvinca on September 14, 2010, 10:45:01 pm

Title: UML Profile - Enumeration - Allow Multiple
Post by: mvinca on September 14, 2010, 10:45:01 pm
Using http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/addingenumerationstagstost.htm as a reference, it is possible to define a tagged value that is limited to an enumeration, but can select multiple values from the enumeration?

ie. color = Yellow, Red
Title: Re: UML Profile - Enumeration - Allow Multiple
Post by: Geert Bellekens on September 14, 2010, 11:02:56 pm
I think the only type that allows multiple values is the RefGUIDList

Geert
Title: Re: UML Profile - Enumeration - Allow Multiple
Post by: Agecoat on September 15, 2010, 01:04:08 am
Mvinca,

I don't think that a enumeration is appropiate for creating a 'multiple select' tagged value.

What you can do is create a tagged value that references one or more attributes of a class.

To do so, within the tool guide you mention;

-------

Preparation

- create a new <<metaclass>> stereotyped "Attribute" element
      - get 'Metaclass' element from 'Profile' toolbox
      - select 'Attribute' element within 'Create New Metaclass' dialog

- create a new <<taggedValue>> stereotyped association from "myStereotype" to "Attribute"
      - select "myStereotype"
      - use the black arrow to draw a line to "Attribute"
      - select 'Tagged Value' in the available stereotypes pop up

- set the target properties of the <<taggedValue>> stereotyped association
      - double click the association line
      - select the 'Target Role' tab within the 'Association Properties' dialog
      - enter the desired tagged value name "myTag" in the 'Attribute Role' field
      - select '*' in the 'Multiplicity' drop down
      - close the dialog

- generate the profile from the <<profile>> stereotyped package

Usage

- create a new <<myStereotype>> stereotyped element
- select the element to view the tagged values for it
- select the tagged value "myTag"
- select the '...' button appearing at the right side of the right tagged value column
- within the appearing "Tagged Values..." dialog, select one or more attributes of the class you want to use for multiple selection

-------

That's it. I do not yet know how to, on meta level, bind the tagged value to attributes of a particular class.

Perhaps this suits you needs. Let me know.

Regards,
Agecoat.