Book a Demo

Author Topic: Create tagged values for a stereotypes attributes?  (Read 5125 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Create tagged values for a stereotypes attributes?
« on: November 13, 2014, 08:51:27 am »
Okie, this is a weird request I am sure.

But, what I want to do (if possible) is to define a set of tagged values for one of my stereotypes that are associated with the attributes (or even operations).

So, it would go like this:

1. Create an element based on my stereotype.
2. Add an attribute (or operation), and
3. Voila! The user is also able to set the value of prefefined tags for that attribute (or operation).

This way, every attribute or operation would have an instance of these same tagged values.

Any suggestions?

Cheers

Jays :-)

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Create tagged values for a stereotypes attribu
« Reply #1 on: November 13, 2014, 09:49:11 am »
Just create a stereotype that extends "Attribute" (or "Operation") and defines tagged values in the usual way.
The Sparx Team
[email protected]

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Create tagged values for a stereotypes attribu
« Reply #2 on: November 13, 2014, 10:41:14 am »
Hey KP, thanks for that.

Having extended an "Attribute" metaclass, how do I make my sterotype use this new attribute stereotype rather than the standard attribute?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Create tagged values for a stereotypes attribu
« Reply #3 on: November 13, 2014, 11:24:04 am »
You have choices:

1. Apply the stereotype to new or existing attributes manually, or
2. Add the attribute stereotype to your technology toolbox and users can drop it onto the element, or
3. Create an addin that implements EA_OnPostNewAttribute and put code in to check if the parent element has the appropriate stereotype and if so apply the attribute stereotype.
The Sparx Team
[email protected]

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Create tagged values for a stereotypes attribu
« Reply #4 on: November 13, 2014, 12:14:19 pm »
Cheers KP, I will investigate those options  :)