Book a Demo

Author Topic: How to change the default Names of an Element?  (Read 5823 times)

Thiyagaraj A

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
How to change the default Names of an Element?
« on: February 20, 2008, 11:36:19 pm »
I am using a profile. I have a created a stereotype "XXXX" which extends "Activity" MetaClass. But When I click and drop, the element name comes as "Activity1". Is it possible to get it as "XXXX1" ?
Regards,
Thiyagaraj A.

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: How to change the default Names of an Element?
« Reply #1 on: February 20, 2008, 11:50:40 pm »
Have a look at Auto Name Counters in help.
Jan 'Bary' Glas

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to change the default Names of an Element?
« Reply #2 on: February 21, 2008, 12:01:42 am »
Actually, that would change all Activity elements.

In your profile, you need to assign a _metaclass attribute to your stereotype. In the initial value box provide the name that you want the new element type to display. Check the documentation for more info.

David
No, you can't have it!

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: How to change the default Names of an Element?
« Reply #3 on: February 21, 2008, 01:02:31 am »
Ah, I was not reading properly. Sorry.
Jan 'Bary' Glas

Thiyagaraj A

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: How to change the default Names of an Element?
« Reply #4 on: February 26, 2008, 04:37:38 pm »
thanks, we have to add an attribute to the stereotype element : metatype="XXXX"
« Last Edit: February 26, 2008, 04:38:46 pm by thiyagaraj_a »
Regards,
Thiyagaraj A.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to change the default Names of an Element?
« Reply #5 on: February 26, 2008, 11:19:33 pm »
Quote
Actually, that would change all Activity elements.

In your profile, you need to assign a _metaclass _metatype attribute to your stereotype. In the initial value box provide the name that you want the new element type to display. Check the documentation for more info.

David
Please see the above correction. I apologize for the error; I should be more careful about proof-reading my own stuff before I post. [In particular, note the leading underscore, as well as the fact that the entire word is lower case.] See the Supported Attributes page in the EA help file. In the help index, you must look up Supported Attribute (without the plural), then Stereotype, in UML Profiles.

David

PS: For some reason YABB is not letting my modify previous posts any more. Hopefully readers of the earlier one will catch the correction here.
No, you can't have it!

Thiyagaraj A

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: How to change the default Names of an Element?
« Reply #6 on: February 27, 2008, 07:17:28 pm »
I noticed that underscore but, when u write like _metatype its not taken as metatype. Give it as metatype without underscore. The problem may be with with EA or EAhelp. :-?
Regards,
Thiyagaraj A.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to change the default Names of an Element?
« Reply #7 on: February 28, 2008, 01:06:45 am »
No, it's not with the help.

If you write it - in the EA model of the profile, not in the XML stream - with the underscore then EA will remove the underscore and add the metatype to the profile XML file. Once that's done EA will react appropriately.

Note that in order to get some parts of your MDG technology to recognize your metatype, you must give your profile a name. You then refer to the metatype as <profile name>::<metatype>. Note that this is case sensitive, and both colons must be there. [Not the angle brackets though, I added them as delimiters of course.]

David
No, you can't have it!