Book a Demo

Author Topic: Multi value/selection tagged value  (Read 4617 times)

Boron

  • EA User
  • **
  • Posts: 111
  • Karma: +6/-0
    • View Profile
Multi value/selection tagged value
« on: March 14, 2013, 09:03:09 pm »
Hello,

is it possible to create a tagged value that has has not only one value but allows selection of more than one value?

Background: In my software I have a central state machine (states: Init, Normal, Error). This state machine calls, or does not call, C-functions depending on the system state.
In my EA model I have functions (designed as ports of classes, implemented as C functions) that have to be called by the state machine. Due to other reasons I have to write the information in which state a function has to be called at the function and not at the state machine. One function has to be called in Init and Normal, the other function in all three states for example.

My idea was to use a tagged value based on an enum type that offers all possibles states. But instead of selecting only one of all possible states I would like to select more than one, or all states, or even none of them, ...

Maybe this idea is complete crap, therefore alternative ideas are welcome (note elements with list of states are not an option).

Many thanks.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Multi value/selection tagged value
« Reply #1 on: March 14, 2013, 09:57:06 pm »
Yes and no. You can create tags that refer to stereotyped elements. I could not find the right help entry, but it should be there somewhere under structured tag type. Once you have such a tag you can choose appropriate elements with that stereotype and they appear sort of multiple choice.

q.

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Multi value/selection tagged value
« Reply #2 on: March 14, 2013, 11:44:04 pm »
The xml would look like this when defining the tagged value as part of a stereotype:

<Tag name="locationMetric" type="locationMetric" description="List of activity metrics by location" unit="" values="" default=""/>

You then need to define under taggedvalue type, ie locationMatric in this case under a TaggedValuesTypes section:

<TaggedValueType property="locations" description="" notes="Type=RefGUIDList;Values=Class;Stereotypes=Location;BaseStereotype=LocationMetric;"/>

Note the use of RefGUIDList, this is what allows the selection of multiple 'Locations' in this instance. Try searching on RefGUIDList in the help....

Regards,

Jon.

Robert Sheridan

  • EA User
  • **
  • Posts: 105
  • Karma: +0/-0
    • View Profile
Re: Multi value/selection tagged value
« Reply #3 on: March 15, 2013, 06:42:22 am »
I do not have access at the moment to the relevant profiles, but I am pretty sure I created a tagged value with a lookup on another stereotype which allowed multiple selections by using the link mechanism described in the EA help and, I think, setting multiplicity of the end of the link to 0...*.  I set this up to enable us to select which conceptual components a change would have an impact on.