Strange behavior of inherited properties of UML Stereotypes in Enterprise Architect - enterprise-architect

I created a profile (MyProfile) which I import via UML profiles in my EA project. MyProfile has one Stereotype (MyStereotype).
If I apply MyStereotype to a class (MyClass), I cannot see any tags of the Stereotype. I see the tags only after I do "Sync Tagged values and Constrains".
So the first question: Is it possible to "automatically" see the tags of a Stereotype in the class to which Stereotype is applied (right after I do apply or the Stereotype). Or "Sync..." is the only command to "push" the tags to the MyClass?
If I change a name of any Attributes of Stereotype AFTER the import, I cannot see the updated name in the MyClass, even if I do "Sync..." command again, after the change of the attribute name. Of course before the "Sync.." I do "Save as a profile" for the appropriate Profile Package.
So the second question is: Is there a way to update the name of an Attribute in the situation OTHER than delete a reference to a package and Import it again (which seems to be inconvenient and error-prone)?

You don't apply a profile to a class but a model. You apply a stereotype of a profile to a class. The synch is only needed if you altered your profile and want to get the newly added stereotype properties (aka EA tagged values) applied to existing stereotyped elements.
No. Automatic changes are not foreseen. For a good reason: altering a profile means you have a new version. Changes to a profile will give the whole model a (completely) different semantics. It's very touchy to alter a profile. It shall be stable and changes to a profile must go with a migration procedure. Rule of thumb: think first, act later.

Related

Version controlled meta information such as tags and filters in EA

The goal is to have a fully version controlled EA model with the UML/SysML/... content aswell as metainformation like tags (inluding enum type specification) or configured filters.
Using the CVS-integration with SVN its easily possible to synchronize the general model data within the team. Tags can be defined by a developer as a enum with the valid values by adding the following snippet to "UML Typed" -> "Tagged Values Types":
Type=Enum;
Values=A, B, C;
I expect EA to synchronize the Tags enum definition using the VCS once created or after the first usage. However, EA seems to only sync the tags that have been applied to model elements without any meta information like enum-definitions or descriptions. I can confirm that the defined tag gets saved inside the "local model"-File of the EA-Project and is not saved in some user-only directory.
One possible solution I found is using the "Export/Import Reference Data" function of EA that is described here and to sync the data in a separate repository. It's a really clunky approach including several manual steps that can lead to faults - such as forgetting about exporting after a change of the tagged value types.
Is there a better solution that I just missed?
With the version control integration you are storing package information into an XMI file and upload that to the version control system (SVN in your case).
The tagged values definition is meta- information that is not stored in that package, and thus not part of the XMI file that is uploaded to SVN.
The best way to deal with things like this is to add tagged values to stereotypes in a UML profile, that is packaged into an MDG file.
MDG files can be considered as packaged meta-models. You can store the MDG file in your version control system as well, and instruct users to use the latest MDG file when using EA.

How to inherit attributes in class/block diagram using Eclipse Papyrus?

I'm creating a very simple class diagram using the Eclipse Papyrus but I'm not able to represent instances correctly.
First of all, I'm using the SysML 1.6 profile, so my classes are actually represented in a Block Diagram instead of classes, but I believe that this does not change anything in my problem.
After creating a simple class/block in my block definition diagram (bdd) I defined some attributes for my block like the example below:
When I tried to create some instances of my block ("parts" in SysML naming convention) using an "Instance Specification" I'm not able to inherit these attributes and fill them with actual information like the "name" and "quantity" in this example.
It's possible to see that my classifier is correctly set as "My component".
The Papyrus documentation for the Object diagram is clear and says that these Instance Specification should include my attributes so I don't know what I'm doing wrong.
I've tried since now:
Create instances in the same block diagram (bdd);
Create instances in another dedicated diagram of the type internal block definition (ibd);
Use the Papyrus context menu to show/hide all my compartments. Any of them works to show my attributes.
Apparently, the same problem occurs without any SysML profile and using pure UML like this question here (from 2016!!)
Papyrus version: 6.1.0

Enterprise Architect: Change diagram type (MetaType) by script

i have to change the diagram type of a lot of diagrams within my Enterprise Architect model. The change can be made manually using following option (that works as expected):
Select diagram - Diagram - Advanced - Change Type...
As I have to change a lot of diagrams I have created a script which searches for all concerned diagrams and change the type automatically. I wrote already a lot of JScript EA scripts for changing some modeling elements. Unfortunately, this feature seems not be available over the scripting interface.
I have to change the "MetaType" of the the diagram object. But this is read-only (see http://www.sparxsystems.com/enterprise_architect_user_guide/12/automation_and_scripting/diagram2.html). Therefore, I got an error.
var currentDiagram as EA.Diagram
currentDiagram = theDiagram
currentDiagram.MetaType = MY_DIAGRAM_METATYPE // ERROR
In the next step I searched for appropriate functionalities in the Repository interface (http://www.sparxsystems.com/enterprise_architect_user_guide/12/automation_and_scripting/repository3.html) and in the project interface. But I found nothing appropiate.
I am using Enterprise Architect 12.0.1215 and I used JScript.
Has anyone already tried this by script?
Have I missed something?
Is there another approach to achieve the diagram type change by script?
Thanks in advance!
You have to do that in two steps (if you change to different MDG diagram types). E.g. to change a Class diagram to a BPMN2.0::BPEL you first change Diagram_Type from Logical to Analysis. Additionally you need to add MDGDgm=BPMN2.0::BPEL; to StyleEx. In case your old diagram is from another MDG you need to modify the existing MDGDgm attribute in StyleEx.
As Uffe noted, the diagram type in the API is r/o. So if you need to change that you would need to do something like
Repository.Execute("UPDATE t_diagram SET Diagram_Type='Analysis' WHERE Diagram_ID=<theId>")
where <theId> would be the correct diagram ID.

Display Notes of Custom Stereotypes in Enterprise Architect

I want to create my own custom toolbox. Therefore I created a metaclass and a stereotype. In the stereotype I wrote a note that gives some instructions about how to populate the object.
Problem is, when I create my MDG Technology, the Notes won't display in the objects I create in my diagram..
How can I fix this and display the Notes for every object I create?
You can either
Write and MDG-Addin to populate the notes for your elements.
Add an element with your stereotype to the template package and add the required notes there. This will have to be done on each model that uses your MDG.
Firstly I'm assuming that you can see the notes you seek on the Properties page of an element you create using your toolbox i.e. the notes field is populated.
If it is, check that notes visibility is turned on by doing these two things:
1) Select the element and go to Element->Feature and Compartment Visibility. Check the Show Notes box. Hit OK
2) Right click on an element and choose Advanced->Use Rectangle Notation

Set Defaults on attribute

In EA I when I am adding attributes to a class I use the insert button. I would like to change the default new attribute to be public and of type string. I quickly did a search and found nothing. EA is hard to search for based on so many bogus responses.
So I thought I would quickly ask here.
Thanks in advance.
I'm fairly sure there isn't an option for this.
If you create your own UML profile (with a customized diagram type), you can set the default attribute type for attributes created from the diagram toolbox (not from within the Properties dialog), but even then there isn't a way to specify the default visibility.