Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: jim_colorado on August 29, 2018, 08:40:24 am
-
What is the best way to create a 1 to many tag value? I thought I could use a CheckList but I have not gotten it to work.
For Example Values=Red, Blue, Green, Yellow;
I want to be able to select more than one value, for example, Red and Blue.
-
You can't. However tagged value names don't have to be unique so you can have multiple single-selection tagged values. There is an option to view duplicate tags that you will need to turn on.
-
Thank you. I guess I am wasting my time trying to use CheckList.
-
You can select multiple values for a tag value using the picker control with a tagged value... I sometimes use the concept of a taxonomy list to allow (taxonomy package with 2 stereotype classes (branch and leaf; leaf is type of branch) arranged in a tree hierarchy - then based on the need pointing to either branch (can then select both branch type and leaf) or only leaf)...
That could help...
-
You can select multiple values for a tag value using the picker control with a tagged value... I sometimes use the concept of a taxonomy list to allow (taxonomy package with 2 stereotype classes (branch and leaf; leaf is type of branch) arranged in a tree hierarchy - then based on the need pointing to either branch (can then select both branch type and leaf) or only leaf)...
That could help...
Sorry David, I don't understand anything you've said. Can you rephrase? In particular, can you indicate the resultant tagged value definition - such as:
Type=Boolean;
Default=True;
Paolo
-
Sorry, late night post... When I create a profile, I frequently use the stereotype connector for tagged-value and using the connector's target role, this results in the source element having a tagged value added with that roles name.
Class connector target rolename Class
[cvTerm] ----------<tagged value>----------------------{glossaryMembership}->[cvGlossary]
When the profile is generated, dropping cvTerm class on diagram allows you to use the ... picker control to select the stereotype cvGlossary...
Type=RefGUID;Stereotypes=cvGlossary;
Setting the multiplicity on the role, will allow you to select multiples....
SO I use stereotypes for a taxonomy (package for the Taxonomy, class for the Entry in the Taxonomy)
taxPackage.Colors; taxEntry: Red; taxEntry: Yellow; taxEntry: Green (placed under Colors)
use the same approach, set your multiplicity on the role for your selection (e.g. ColorChoices)
Access the TV click the "..." to activate the picker, use the Ctrl key to allow multiple selections... navigate and select...
Sometimes in a Taxonomy, you might have Category and Entry (leafs)... Example in my Taxonomy for Non-Functional Requirement Types, I only allow for the selection of a leaf, but I want the taxonomy to have depth.... so I use class stereotypes of category and entry... restrict to Entry if you want them to select a Leaf, restrict to Category if you want them to have both.... Leaf is specialized into Category.... (so they can pick either...)
DOES that make it clearer? I would have included a picture, but can't figure out how to do that?!!
NOTE: KP Posted the steps for the tagged-value way to select multiple elements via the GUID way back in 2013 (copied steps from that post)
1. Go Settings > UML Types > Tagged Values Types and create a new tagged value type called "locations" with detail "Type=RefGUIDList;Values=Class;Stereotypes=Location;"
2. Create a package with «profile» stereotype. Give it a diagram.
3. On the diagram, drop a stereotype element with an extends association to a metaclass element. When the dialog appears for the metaclass, choose "Requirement".
4. Give the stereotype class an attribute named "locations".
5. Save the profile.
6. Go Tools > Generate MDG Technology File and follow the wizard's instructions. When asked what to include in the technology, tick the options for Profiles and Tagged Value Types. Select the profile saved in step 5 and the tagged value type saved in step 1.
7. Go Settings > MDG Technologies > Advanced > Add > Add Path and add the path where you saved your technology file.
8. Find your profile in the toolbox and drop a stereotyped requirement on a diagram: it should have your RefGUIDList tagged value.
The taxonomy stuff above is pretty basic stuff Package, containts elements, the steps above to create the taggedvalue to do the multiselect just has to be modified to constrain you to the stereotype of the element you are using to represent the available choices... KP used :"locations", my example was "colors"
-
Picture would be good. You stick it on some kind of public host and use a link to it. Please not Dropbox tho' as I can't see Dropbox from my work computer.