EA-Matic is an add-in for Sparx Enterprise Architect that enables rapid EA add-in development. It uses the built-in scripting features of EA to relieve you of developing, building and deploying full-blown EA add-ins.
Aimed at corporate environments it greatly reduces the time to introduce new functionality.
With EA-Matic you can develop your EA add-in using nothing but EA, and deploy changes instantly to all model users.
The possibilities are endless. You can validate your own modelling rules, keep your model consistent by preventing the deletion of elements that are still used, add your own context menus, or make self-maintaining diagrams. The only limits are those of your imagination.
The table below shows how add-in development with EA-Matic differs from classic add-in development.
|EA-Matic||Classic add-in development|
|Required tools||Only EA||Visual Studio, Sharpdevelop, or equivalent IDE|
|Installation of a new version||Instantly available for all users without the need to install anything again on the workstations.||Msi-deployment on all workstations|
|Security access on development machine||Normal user rights are enough.||Local Administrator rights required.|
EA-Matic requires .Net framework 4.5 which is already installed on most Windows installations.
EA-Matic is part of the Bellekens EA Toolpack which includes other useful add-ins such as
When installing you can choose which of the tools you wish to install.
- Using the add-in menu with EA-Matic
Shows how to add menu options, control their status and react on click events.
- Preventing accidental deletes with EA-Matic
Disallow deleting elements that are still used as type in attributes or parameters
- Self-maintaining diagrams with EA-Matic
Make diagrams that keep themselves up-to-date
- Synchronize object and classifier name with EA-Matic
Ensures objects have the same name as their classifier
- Automatically synchronize overrides with EA-Matic
Ensures signatures of overriding operations are always equal to the signature of the overridden operation
- Configure your own default line styles with EA-Matic
Set your own default line styles depending on connector type, and apply those to new connectors or a whole diagram.
This one minute video will show how easy it is to create a new add-in for EA using EA-Matic
These steps below show you how to repeat the the steps from the introduction video on your own.
First make sure you have a script ready to use by EA-Matic.
Add EA-Matic in the comments of the script and save it. Only scripts that contain EA-Matic will be considered by EA-Matic.
Open up the EA-Matic dialog with the menu option Extensions|EA-Matic|Settings.
On the left there’s a list of all add-in events you can subscribe to. Check each event you wish to add to the selected script.
Close the Settings dialog and press the refresh scripts button in EA
Now open the the selected script and notice the newly created function(s)
function EA_OnContextItemDoubleClicked(GUID, ot) 'Add code here end function
Add your functional code to the script and re-open the settings dialog to load your new code into EA-Matic. All changes to scripts are automatically loaded into EA-Matic every 5 minutes, but opening the settings dialog forces a reload of the scripts.
function EA_OnContextItemDoubleClicked(GUID, ot) MsgBox("Hello World") end function
Now you can test the new code by double-clicking an element in your model.
How it works
Enterprise architect uses operations with well defined names as “events” to trigger when something in EA happens. In order to subscribe to such an event an operation with this particular signature needs to be implemented in the add-in. The EA-Matic add-in catches all the events, and forwards them to the scripts if a function with the same signature exists.
EA-Matic also forwards the events to the local scripts that are loaded from the installation folder, and to any scripts defined in an MDG technology.
Frequently Asked Questions
Why is my new script not showing up in the EA-Matic script dropdown?
There can be two reasons:
- You forgot the EA-Matic keyword
make sure that your script contains the keyword EA-Matic somewhere in the comments of a the script like this:
- There is an error in the script
If the script interpreter cannot interpret your script then it will not show up in EA-Matic. Make sure that you have solved all issues, and that your scripts runs fine by calling them directly in the EA scripting environment.
Why is my script executed when I start EA or when I start EA-Matic?
You have top-level code in one of the EA-Matic scripts. When loading the EA-Matic marked scripts EA-Matic will need to interpret your scripts.
Interpreting script code means executing the top-level code. If you have code like the example below the messagebox with “Hello World” will show up every time the scripts are reloaded by EA-Matic because the call to execute main at the last line is top level code that will be executed.
'EA-Matic sub main MsgBox("Hello World") end sub main
Remove the last line calling main to avoid this problem.