Enterprise Architect version 15.0



My Profile

Social Media Channels

facebook  twitter  youtube   linkedin



Sparx Systems

99 Albert Street
P: +61 3 5345 1140
F: +61 3 5345 1104
Sparx Systems specializes in high performance and scalable visual modeling tools for the planning, design and construction of software intensive systems. A Contributing Member of the Object Management Group (OMG), Sparx Systems is committed to realizing the potential of model-driven development based on open standards. The company’s flagship product, Enterprise Architect, has received numerous accolades since its commercial release in August, 2000. Enterprise Architect is the design tool of choice for over 740,000 registered users worldwide.


In order to copy a Tagged Value named "mytag" from the source model to the target model you can add the following to the Class template (Ctrl+Alt+H):


%if classTag:"mytag" != ""%


For more information on transformation templates see:



Wednesday, 03 November 2010 03:45

Workflow Script Template

This resource updates Enterprise Architect's built-in Workflow Script Template. It provides more detailed documentation and a clearer structure that will help those who are new to Workflow Scripting. It also includes a comprehensive set of available workflow functions to choose from. Therefore you can focus on defining your Workflow rules, rather than rewriting skeleton code to invoke built-in Workflow functions.

Once deployed, the template will be automatically applied to any scripts created in a Workflow Script group.


To deploy the template:

  1. Download and extract the Zip File.
  2. Copy the file entitled "WorkflowTemplate.vbs" into the Enterprise Architect config/Script Templates directory.

For example on a typical 32-bit Windows installation, this directory can be found at:

C:\Program Files\Sparx Systems\EA\Config\Script Templates.


More information about Workflow Scripting can be found in the Enterprise Architect User Guide.

This example add-in demonstrates how to define a custom compartment to show the Notes defined by an Element's classifier. For example, an Object Instance will show the notes of the Class that it instantiates.


The CS_AddinFramework example project can be used as the basis to implement this functionality. The code snippets attached to this article can be inserted into any working C# add-In.


Summary of Code


Two broadcast events need to be implemented to define a custom compartment - EA_QueryAvailableCompartments and EA_GetCompartmentData.


EA_QueryAvailableCompartments returns the names of the custom compartments to be made available. Multiple compartments can be defined using a comma separated string. Options could be implemented at this level to globally disable display of certain compartments. For a more detailed example, refer to the API documentation for this event.


EA_GetCompartmentData handles the compartments defined in EA_QueryAvailableCompartments and defines the data to be inserted in the compartment. This event is called for each element on the diagram and each custom compartment to be handled. If the compartment should not be displayed for the current element, return null.


Some basic input checking is included in this example to determine whether the custom compartment is displayed for a given element. The following checks are made:

  • The element has a Classifier ID
  • The referenced Classifier contains some notes
  • The element contains a Tagged Value named named “ShowClassifierNotes” with the value “True” (this helps users of the add-in to prevent breaking the layout of existing diagrams, by giving the user explicit control of the compartment visibility)


Example of the resulting compartment in Enterprise Architect:

classifier notes small

Wednesday, 17 February 2010 05:18

Visualization of Package Dependencies

When reverse engineering existing source code into Enterprise Architect, there is an option to import dependency relationships based on operation return types and parameter types.  These dependencies are only shown between individual classes.  Some users however, wish to view implicit dependencies at the Package level, which Enterprise Architect does not generate by default.

The purpose of these scripts is to generate implicit dependencies at the package level based on the contents of the packages, and to assist with drawing a diagram to show these cross-package dependencies.


Configuring the scripts

In this example, we will take advantage of the new ability to call scripts directly from the Project Browser, introduced in Enterprise Architect 8.0.

  1. Open the scripting window (View | Scripting)
  2. Create a new script group
  3. Name the group "Project Browser"
  4. Set the group type to "Project Browser"
  5. Create a new VBScript under this group and name it "Synchronize Package Dependencies"
  6. Open this new script in the built-in editor and paste in the contents of the file VBS_SynchPackageDependencies.txt
  7. Save
  8. Create another new VBScript under this same group and name it "Synchronize Package Dependency Diagram"
  9. Open this new script in the built-in editor and paste in the contents of the file VBS_SynchPackageDependencyDiagram.txt
  10. Save


Using the scripts

With the scripts successfully added to your model, select the root package in the Project Browser from where you wish to generate your cross-package dependencies. To see the messages output by this script, make sure to open the Output window (View | System Output).

  1. Create a new Diagram of type 'Package' and open it (this diagram is where the dependencies will be drawn)
  2. Right-click on the context package in the Project Browser and select "Scripts | Synchronize Package Dependencies".  The Output window will inform you when the process has been completed and report how many new package dependencies have been found.
  3. Right-click on your context package in the Project Browser again and select "Scripts | Synchronize Package Dependency Diagram"
  4. Several packages should now appear on your open diagram, but will all be piled on top of one another.  We can now use EA's automatic diagram layout tools to organize these packages into a sensible layout.
  5. Open the Diagram Layout window ("View | Layout Tools")
  6. Select "Digraph" layout and click the "Apply Layout" button

These scripts can be executed again at any later time to update any changes in your cross-package dependencies that may have occurred since the original execution.  Dependency relationships are added and removed between packages as necessary by running the “Synchronize Package Dependencies” script, and running the “Synchronize Package Dependency Diagram” script again can automatically add/remove packages from the currently open package diagram to show the items that are now relevant.  If any items are added or removed from the diagram, you may need to run the automatic diagram layout tools again.





Thursday, 17 December 2009 03:32

Listing all Connectors in a Diagram


This script has been produced in response to requests from the Enterprise Architect community for a way to display all Connector information for a given diagram. The script displays this information in Enterprise Architect's Search window.

The script iterates over the 'Diagram Link' API collection for a given diagram to retrieve the details of each connector.

Installation Instructions:

  1. Open Enterprise Architect's Scripting window.
  2. You may create a New Group or place the script within an existing Group.
  3. Right click the Group and select the option "New JScript".
  4. Label the script "List Connectors".
  5. Copy the script below and paste it into the script "List Connectors".
  6. Save the script.
  7. Select the diagram of interest in the Project Browser. (If it is already open, ensure that changes are saved.)
  8. Select the script "List Connectors" and execute it by selecting the "Run script" button.
  9. All of the connectors for the selected diagram will appear within Search Window.

Please copy the script below:

 * Script Name: ListDiagramConnectors
 * Author: Michael Fraser (Sparx Systems)
 * Purpose: Lists relationships between objects that appear on the diagram that is
 * currently selected in the project browser
 * Date: 2009-12-17

// ==========================================
// ==========================================
var DIAGRAM_OT        = 8;

// The columns that will appear in the Model Search window
var SEARCH_SPECIFICATION = "<ReportViewData>" +
                            "<Fields>" +
                            "<Field name=\"CLASSGUID\" />" +
                            "<Field name=\"CLASSTYPE\" />" +
                            "<Field name=\"Client\" />" +
                            "<Field name=\"Supplier\" />" +
                            "<Field name=\"Direction\" />" +
                            "<Field name=\"Name\" />" +
                            "<Field name=\"Notes\" />" +
                            "<Field name=\"Client Aggregation\" />" +
                            "<Field name=\"Client Cardinality\" />" +
                            "<Field name=\"Client Role\" />" +
                            "<Field name=\"Supplier Aggregation\" />" +
                            "<Field name=\"Supplier Cardinality\" />" +
                            "<Field name=\"Supplier Role\" />" +
                            "</Fields>" +
                            "<Rows/>" +

 * Main function
function ListDiagramConnectors()
    Repository.EnsureOutputVisible( "Script" );
    Session.Output( "JScript: List Diagram Relationships" );
    Session.Output( "=========================================" );
    // Get the type of element selected in the Project Browser
    var treeSelectedType = Repository.GetTreeSelectedItemType();
    // Handling Code
    switch ( treeSelectedType )
        case DIAGRAM_OT:
            // Code for when a diagram is selected
            var theDiagram as EA.Diagram;
            theDiagram = Repository.GetTreeSelectedObject();
            // Create a DOM object to represent the search tree
            var xmlDOM = new ActiveXObject( "MSXML2.DOMDocument.4.0" );
            xmlDOM.validateOnParse = false;
            xmlDOM.async = false;
            Session.Output( "Working on diagram '" + theDiagram.Name + "' (Type=" +
            theDiagram.Type + ", ID=" + theDiagram.DiagramID + ")" );
            // Load the search template
            if( xmlDOM.loadXML(SEARCH_SPECIFICATION) )
                // Resolve the results node in the xml template
                var node = xmlDOM.selectSingleNode( "//ReportViewData//Rows" );
                // A connector has a one to many relationship with diagram (eg one connector
                // may appear on many diagrams). The DiagramLink object represents an instance
                // of a connector on a single diagram, and contains properties such as its
                // geometry, visibility etc.
                // Get all diagramLinks for this diagram
                var diagramLinks as EA.Collection;
                diagramLinks = theDiagram.DiagramLinks;
                for ( var i = 0 ; i < diagramLinks.Count ; i++ )
                    // Get the current diagram link
                    var currentLink as EA.DiagramLink;
                    currentLink = diagramLinks.GetAt( i );
                    // Load the corresponding connector object for the link
                    var correspondingConnector as EA.Connector;
                    correspondingConnector = Repository.GetConnectorByID( currentLink.ConnectorID );
                    // Add the connector's details to the search data
                    AddRow( xmlDOM, node, correspondingConnector );    
                // Fill the Model Search window with the results
                Repository.RunModelSearch( "", "", "", xmlDOM.xml );
                Session.Prompt( "Failed to load search xml", 0 );
            // Error message
            Session.Prompt( "This script does not support items of this type.", 0 );
    Session.Output( "Done!" );

 * Adds an entry for the method object 'theRelationship' to the xml row node 'rowsNode'
function AddRow( xmlDOM, rowsNode, theRelationship )
    // Cast theMethod for intellisense
    var relationship as EA.Connector;
    relationship = theRelationship;

    // Create a Row node
    var row = xmlDOM.createElement( "Row" );
    // Get client details for the connector
    var client as EA.Element;
    var clientEnd as EA.ConnectorEnd;
    client = Repository.GetElementByID( relationship.ClientID );
    clientEnd = relationship.ClientEnd;
    // Get supplier details for the connector
    var supplier as EA.Element;
    var supplierEnd as EA.ConnectorEnd;
    supplier = Repository.GetElementByID( relationship.SupplierID );
    supplierEnd = relationship.SupplierEnd;
    // Add the Model Search row data to our DOM
    AddField( xmlDOM, row, "CLASSGUID", relationship.ConnectorGUID );
    AddField( xmlDOM, row, "CLASSTYPE", "connector" );
    AddField( xmlDOM, row, "Client", client.Name );
    AddField( xmlDOM, row, "Client", supplier.Name );
    AddField( xmlDOM, row, "Direction", relationship.Direction );
    AddField( xmlDOM, row, "Name", relationship.Name );
    AddField( xmlDOM, row, "Notes", relationship.Notes );
    AddField( xmlDOM, row, "Client Aggregation", clientEnd.Aggregation );
    AddField( xmlDOM, row, "Client Cardinality", clientEnd.Cardinality );
    AddField( xmlDOM, row, "Client Role", clientEnd.Role );
    AddField( xmlDOM, row, "Supplier Aggregation", supplierEnd.Aggregation );
    AddField( xmlDOM, row, "Supplier Cardinality", supplierEnd.Cardinality );
    AddField( xmlDOM, row, "Supplier Role", supplierEnd.Role );
    // Append the newly created row node to the rows node
    rowsNode.appendChild( row );

 * Adds an Element to our DOM called Field which makes up the Row data for the Model Search window.
 * <Field name "" value ""/>
function AddField( xmlDOM, row, name, value )
    var fieldNode = xmlDOM.createElement( "Field" );
    // Create first attribute for the name
    var nameAttribute = xmlDOM.createAttribute( "name" );
    nameAttribute.value = name;
    fieldNode.attributes.setNamedItem( nameAttribute );
    // Create second attribute for the value
    var valueAttribute = xmlDOM.createAttribute( "value" );
    valueAttribute.value = value;
    fieldNode.attributes.setNamedItem( valueAttribute );
    // Append the fieldNode
    row.appendChild( fieldNode );


Monday, 26 October 2009 05:47

C# Add-in template

The following file is a C# Add-in Template for Enterprise Architect. Use it as a base project for any C# Add-in work.

Monday, 26 October 2009 05:44

Delphi Add-in template

This Delphi project demonstrates how to create an Enterprise Architect Add-in using Borland Delphi.

This add-in creates/enables/checks/responds to menus and shows how to include a Delphi form as a tab control in Enterprise Architect.

This project was created in Delphi 3 but should be usable from later versions.

Refer to the Add-ins topics in Enterprise Architect help for further information.

This file is freely usable and distributable provided that it is kept in its original form.

Monday, 26 October 2009 05:38

UML Patterns

What is a Pattern?

Patterns are parameterized collaborations; that is, they are a group of collaborating objects/classes that can be abstracted from a general set of modeling scenarios. Patterns are an excellent means of achieving re-use and building in robustness. As patterns are discovered in any new project, the basic pattern template from previous engagements can be re-used with the appropriate variable names modified for the current project.

Patterns generally describe how to solve an abstract problem, and it is the task of the pattern user to modify the pattern elements to meet the demands of the current engagement.

Before using a pattern it must first be created as a standard UML diagram and then saved as an XML pattern file. This XML file can then be imported as a UML Resource that can be used in any model.

Sparx created GoF Patterns

To get you started with Design Patterns in Enterprise Architect, Sparx Systems provide you with a zip file containing the patterns described in the book Design Patterns - Elements of Reusable Object-Oriented Software by Gamma et al., referred to as the 'Gang of Four' or GoF. Download this zip file of the Gang of Four patterns for Enterprise Architect from the links below.

When you have downloaded and unzipped the file, you can import the GoF Patterns as described in Import UML Patterns.


Download UML Gang of Four Patterns:

Wednesday, 12 December 2012 05:56

Enterprise Architect 10 Official Release

Sparx Systems is Proud to announce the release of Enterprise Architect 10.

Registered users can download Enterprise Architect 10 from: http://www.sparxsystems.com/registered/reg_ea_down.html

Release details and a 30 day Evaluation Trial available at: http://www.sparxsystems.com/products/ea/10/index.html

Support is available to Registered Users at: http://www.sparxsystems.com/registered/reg_support.html

Trial users should use http://www.sparxsystems.com/support/bug_report.html

Wednesday, 28 November 2012 03:55

spatial@gov Event Review

Last week Sparx Systems attended spatial@gov in Canberra with our partner Geoplex.  This is the third year of the event and it was a week of meetings and discussions about data access specifications, infrastructures, tools and industry change.  There was a buzz within the community and a great line up of speakers from Australia and overseas.


The Minister for Lands New Zealand Hon Maurice Williamson injected his enthusiasm into the discussion focussing on the reconstruction of Christchurch and comparing the impact of geospatial technology on society to that of the Internet.

Paul Smits from the European Union Joint Research Centre provided an update on the progress of the INSPIRE initiative and shared his insight as to the inherent value of approaches to the development of spatial data infrastructures, such as those demonstrated through the INSPIRE program. The INSPIRE Data Specifications can be downloaded from here. http://inspire.jrc.ec.europa.eu/index.cfm/pageid/2/list/datamodels


Key focal points of the discussion included open data initiatives such as the New Zealand provision of free and open access to government-held public data,  the Victorian Government increase in access to government data in an effort to spur the economy and the Danish government release of its digital raw material for free public re-use.


Data access will be provided to the public free which will reduce costs for those who have had to previously buy the same data.  It also opens up opportunity for more businesses to create new products and services without having to initially purchase data.


In Australia the Office of Spatial Policy (OSP), the organiser of this event, is a central policy unit, responsible for facilitating and coordinating spatial data management across Australian Government agencies.  There was much discussion and positive expectation from stakeholders concerning the establishment of a National Spatial Information Infrastructure (NSII) an initiative for which  OSP has been appointed as task leader



Modeling of spatial data was discussed by many and there is a shared recognition not only of the productivity value of tools such as Enterprise Architect, but of the need by many in both government and private sectors, to gain a practical understanding of the application.

Page 22 of 26