Ruudjah
Ruudjah

Reputation: 847

Enterprise Architect: How to change type of element?

I have an element which is created as a table. In the "Element Properties" window, I see the Type is Class and Stereotype is table. For other similar tables, the Type is Table and Stereotype is table. Something seems to be icky with this particular instance.

Incorrect table

Correct table

However, when I run the following script

var element as EA.Element;
element = Repository.GetTreeSelectedObject();
Session.Output(element.Type);

The result is (for both tables!) Class. I thought to outsmart the EA UI by programmatically setting the type, but as both tables (the OK table and the "broken" table) both produce Class when asked for the .Type, I'm hesitant to set the .Type using a script.

I have thought about removing this table and re-adding a new one, but this is tedious as the table has a lot of connections.

How to change the Type of this particular "broken" table to "Table"?

Upvotes: 3

Views: 1439

Answers (1)

Geert Bellekens
Geert Bellekens

Reputation: 13701

The problem is that both «table» stereotypes are not the same.

The one where the type indicates Table is the correct one. The other one is a rogue one.

Steps to solve this:

  • Remove the rogue stereotype from the internal stereotype list Configure | Reference Data | UML Types (to prevent the problem from happening again)
  • Change the stereotype from the problematic element to the stereotype «table» from the UML profile EAUML. In a script you can do this by setting the property EA.Element.StereotypeEx to the qualified name: EAUML::table). Manually you can use the [...] button to select the correct stereotype from the correct profile.

Upvotes: 3

Related Questions