Enterprise Architect
How do I extend the pre-defined types in Enterprise Architect to represent the elements of architecture decisions? The pre-defined types are extended using Model Driven Generation (
MDG) technology. Each metaclass defined by Enterprise Architect can be
extended. Follow the guidance in this
video. The Add Stereotype tool in the Profile Helpers toolbox replaces the Edit with Profile Helper menu choice shown in the video. You can see the list of available metaclasses by dragging the Metaclass element from the toolbox to a profile diagram and reviewing the Core Elements and Core Connectors tabs in the Extend Metaclass dialog. For example, the Activity metaclass is extended by Decision Architect to represent the Topic element. Once the metaclass is in the diagram, a Stereotype element can be dragged to the diagram and linked to one or more metaclass elements using the Extension connector. Attributes are then added to the stereotype instance that change its behavior, after the MDG is deployed, when an instance of the metaclass is created and assigned the Stereotype label as its stereotype. The instance can have multiple stereotypes, but if the Stereotype label is removed or changed the behavior reverts back to the metaclass type. For example, if the Topic stereotype is removed from the stereotype of a Topic element instance, it again appears as an Activity type.
How do I change the appearance of a type extended from a metaclass using MDG technology? Enterprise Architect provides
Shape Scripts. Follow the guidance in this
video. Add the
_image attribute to the Stereotype extension and use the Shape Editor to construct the custom image that is shown when the defined stereotype is in the stereotype list of the corresponding element instances. The available element and connector properties are listed
here.
How do I add pre-defined tagged values to a type extended from a metaclass using MDG technology? Enterprise Architect provides
Structured Tagged Values. Follow the guidance in this
video.
How do I add and remove entities from Enterprise Architect collections using the Automation Interface? The EA Automation Interface organizes elements in
collections. Use the AddNew method to insert an element into a collection. Note that you must call Update on the returned object to complete the AddNew, and call Refresh on the collection. Use the DeleteAt method to remove an element from a collection, where the index is the element location in the collection starting from zero. Call Refresh on the collection after removing an element.
Invoking Repository.AdviseConnectorChange does not result in a callback to EA_OnNotifyContextItemModified. This feature does not work as expected compared to the similar AdviseElementChange operation. In EA version 11.1 and later editing a connector tagged value directly does result in a callback.