Top Community Contributors
Enterprise Architect User Group: London 2017
Written by DT_Sam
RepoDoc, a call for testing
Written by ArchimetesRead more...
- We are Profiling EA Users
Managing a student project with Enterprise Architect - Part 4
Written by doug rosenberg
- CIO Review's 20 Most Promising BPM Solution Providers 2017
- Sparx Systems Pro Cloud Server - Coming Soon
- SD Times - How UML makes a DevOps-driven digital transformation possible
Use C#, Java, for your VB Scripting
Written by Helmut Ortmann
Helmut OrtmannFreelancer (Consultant)
EA Version 13 supports developing in C# and Java with full EA API support. They name it Hybrid Scripting. This article shows you with a little example how to use C# for your Scripting. After you have understood C#, it should be easy to use Java in a similar way. The main idea is to use a small wrapper you call within your VB Script. Of course, after you have understood it's also easy to write this little wrapper for JavaScipt/JScript.
Just insert the line:
- 'RunCommand("myLogic.exe, "", " ")'
in your VB Script and you are done with VBScript to call your C#. Java would be similar.
Let's make a quick example with EA Version 13 and C#:
Make an EA C# ConsoleApplication
- Create a new EA Project
- Create a Package ('Select and Apply Model Pattern')
- C#, RepositoryInterface 4.0
- Build the Application
- Have a look in the generated Application
- c:\temp\hybrid\RepositoryInterface 4.0\
Import VBScript wrapper to call C#
- Configure, Transfer, Import Reference Data
- Make EA Scripting visible
- Code, Scripting (you may have to refresh Scripts)
- You see the new VB Scripts inside the ScriptGroup HybridScripting:
Run C# ConsoleApplication.exe
- Adapt VBScript RunCommandTest
- Adapt path to 'ConsoleApplication.exe'
- Line:28/29 Needed references
- Line:35 Path to *.exe which executes your logic
- Line:36 The call of the wrapper, result contains the StandardOutput of the Script
- Run VBScript RunCommandTest
- Right Click on RunCommandTest
- Run Script
How do you use it
There are two approaches: Generates you VB Script by inserting the the wrapper Call in the EA templates at the appropriate location. The other way is to remove the template and just call the wrapper like
'result = RunCommand("myLogic.exe, "", " ")'
instead of the using the template scuffold.
Under the hood
EA delivers the two dlls:
They expect the Process ID, first parameter, to know which EA Instance the *.exe wants to use. So, RunCommands makes:
- Estiminate the own Process ID
- Call 'RunCommand...'
- Reads the Standard output from your *.exe
- Returns to Standard output to the caller
Inside the *.exe you have full access to the EA API.
- SPARX Webinar Hybrid Scripting
- SPARX Tutorial Hybrid Scripting
- hoTools Hybrid Scripting
- RunCommand.vbs (The wrapper to call your C#, Java,..)
- RunCommandTest.vbs (An Example with EA example C# Hybrid Script ConsoleApplication.exe, see Tutorial )
You have a diagram, and you want to show or hide:
- Port, Activity Parameter, Action Pin
- Label of Port, Activity Parameter or Action Pin
- Type of Port
Select the nodes where you want to show or hide, click on the appropriate hoTools Button and hoTools will do the rest.
Ports are powerful means to define a structure with specified points of interactions (Ports). The Port type is the specification of the interaction point. It also works for:
- UML Port
- SysML Block, Part, Port
- Activity Parameter (no type hide/show supported)
- Action Pin (no type hide/show supported)
- Nothing on the diagram to run on the whole diagram
- Nodes you want to perform the show/hide operation
- SP Show Port, Parameter, Action Pin
- HP Hide Port, Parameter, Action Pin
- SPL Show Port, Parameter, Action Pin Label
- HPL Hide Port, Parameter, Action Pin Label
- SPT Show Port Type
- HPT Hide Port Type
- Move selected ports
- Explore the WiKi for mode information.
- You need local administration rights to install an EA Addin
- Load hoTools2.1.1.msi from Github or the attachment
- Deinstall an older release of hoTools
- Run hoTools2.1.1.msi
- hoTools in GitHub
- WiKi in GitHub
- Description Port show/hide
- Release with installation description and more
I appreciate your feedback !!
Build your EA SQL Query with a tabbed editor. Load and Save it to your file system. Use elaborate Macros to access EA features like #CurrentItemID#, DiagramSelectedElements_IDS#, .. Everything tuned to make it easy and to concentrate at the job of hand. Even Conveyed Items on a connector are easy to handle.
Just right click in the Editor and 'Insert Macro, Template, Recent File,..'.
You want to use your beloved Editor. Just do it. The SQL are saved to file and hoTools recognizes changes made outside.
- Tab editing
- Macros, Insert Macro from a list
- #Branch#, #Package#,#DiagramElements_IDS#, #DiagramSelectedElements_IDS#, #CurrentItemID#,#CurrentItemGUID#
- #ConnectorID#, #ConveyedItemsIDS#,
- Comments // my lovely Comment
- DB specific section easy without remembering the syntax
- Templates, Insert Template from a list
- Wild Card support without doind anything as to write your beloved '*' or so. It will be converted according to current DB
- Just use *,?, %,_,^or ! (hoTools translate sit to your database)
- Recent File
- CTRL+L Load from File
- CTRL+R Run SQL
- CTRL+S Store
- CRRL+SHIFT+S Store all
- Help (just a click from you)
- Get Error of SQL
- Get SQL as sent to EA
- A lot more to find out
If you have a <Search Term> enter it and run (Click on Button or CTRL+R). Remember: Unde Menu Help you find:
- SQL Error with one click
- SQL sent to EA with one click
The results are schown in EA Model Search Window.
Load Tab from recent files
- run hoTools2.02.msi (attachment or GitHub)
- .NET 4.5 or greate
- Enterprise Architect 9.0 or greater
- Local administration rights
Thanks to Geert Bellekens who gave me lot of ideas and code from his great NAVIGATOR!
Your advice is appreciated!
Delete or move elements to package which are found by Searches (SQL, Query Builder, Standard Searches). These vbscripts allow you to easily handle found elements and to develop your own vbscripts to manipulate found things. In effect these scripts use bookmarked or elements copied to clipboard. It's an extension fo Geert Bellekens VBScripting Library.
- Use SQL Searches to move or delete found elements, diagrams or packages copied to Clipboard
- Use Bookmarked elements from e.g. Standard / QueryBuilder Searches to move or delete elements
- Handle bookmarked or result of SQL searches with your individual script
These scripts are using Geert Bellekens Script Framework (powerful!, Open Source)
- See also there for updates, folder ho
Standard Search / Bookmark:
- Set bookmarks
- e.g. by Standard Search
- If move: Select target package in ProjectBrowser
- Run Script:
- hoModelSearch, DeleteBookmarkedItems or
- hoProjectBrowser, MoveBookmarkedToSelectedPackage
Standard Search / Clipboard:
- Run SQL Search
- each row shall contain GUID of the items to handle
- Copy wanted rows to clipboard (eg: CTRL+A, CTRL+C)
- If move: Select target package in ProjectBrowser
- Run Script:
- hoModelSearch, DeleteClipmarkedItems or
- hoProjectBrowser, MoveClipmarkedToSelectedPackage
In Action: Delete item found by SQL Search or Query Builder Search
- Run SQL Search with element GUID as result / Run Query Builder Search
- Copy to Clipboard (SQL Search / Bookmark (Query Builder Search)
- Run Delete ClipboardedItems / Delete BookmarkedItems
Move items found by SQL Search to package
- Copy found elements to Clipboard
- Select Package, Right Click, Scripts,...
Move bookmarked items
(bookmarked in eg. Diagram or found by Standard Search / Query Builder Search) to selected package)
- Run Standard Search or Query Builder Search
- Bookmark wanted elements
- Select Package, Right Click, Scripts,...
- It works
- Project DataManagement, Import ReferenceData, Select File (Script.xml)
- Select 'Automation Scripts'
- See the scripts for details:
- ho (reusable groups to extend functionality according to your needs)
- hoModelSearch Group of type ModelSearch
- hoProjectBrowser Group of type ProjectBrowser
Bookmarks (see also EA help):
- Search Window: Query Builder Results, Right Click, Bookmark Element,
- Diagram: Select elements, Shift + Space
- Diagram: Select elements, Edit, Bookmark selected,
ho_Tools is a powerful "Find and replace" tool for texts in Elements, Diagrams and Packages. You can search recursive from a starting package or globally by a search.
It allows simple text search or powerful regular expressions to change name, note and more.
ho_Tools easily allows you to find & replace strings in your model. This is done by simple text comparison or with powerful regular expressions.
It works on EA elements, Packages and Diagrams and can change:
- Tagged Value
There are the following two operating modes:
- Search recursive from a selected package
- Use an EA Search like Simple or your own SQL search
First test the search. The Icons for the type need to be displayed to let ho_Tools work properly
If you have advices or questions feel free to contact me.
-Deinstall old release
-Run the ho_Tools_Setup.msi;
- Current release: https://dl.dropboxusercontent.com/u/66337741/ho_Replace/ho_Replace.zip
A toolset to make every day life easier. The main functions are:
- Set line style in diagram by just a click
- Searches and services at Buttons / Keyboard keys
- Navigate by click
- Change Author
- Change *.xml file of a controlled package
- Create / update Activity diagram for an operation
- Quickly set line style to selected Diagram, Elements and/or Connector
LV= Lateral Vertical
LH= Lateral Horizontal
TH= Tree Vertical
etc., see tooltip
- Quick search for class, attribute, operation
- Navigate between structure and behavior
- Specification (Open the links of file properties, source code, *.xml file)
- Create Activities and Parameters for operations
- Searches and services on buttons and keyboard keys
- Sample Queries
- Sample scripts at your finger tip
- And a lot more to experience
Have a look at the help and give it a try.
You get the newest release from:
- Run ho_tools_Setup_V1.035.msi (delete old release first)
- Copy ho_ToolsTechnology.xml to c:\Programme\Sparx Systems\EA\MDGTechnologies\
- With EA:
Project,Import Reference Data, ... ho_Tools_Scripts.XML
Find Usage of an Element
You have an element in
- Search Window
and you want to see where this element is used.
- Right click on the Element (Browser, Diagram, Search Window)
- Scripts, Element Usage
- EA lists the usage of the element in the Search Window
Which usages are detected?
- class, instance, object, part
- type in attribute, operation
- usage in diagram
- operation to Sequence, Behavior, Call Action
Which repositories are supported?
- SQL Server
- Copy hoTools.xml into ...\Sparx System\EA\MDG\Technology
- Open Scripting View (either in View or in Tools)
- Create New Scripting Groups of type: Project Browser, Diagram, Model Search
- Create in each group a VB Script (New VB Script) and name it “Element usage” or so
- Copy the Script in each group (Copy and Past the content of the existing "Find Usage" Script
Set completeness marker for classes in diagrams
When seeing a class in a diagram it's unknown whether this class is shown with all its associations. This Addin modifies the class border (bold,standard, red) of the diagram to visualize whether the class is :
- visualized with all its model wide associations
- visualized with all its associations of the diagram
- incomplete visualized (hidden associations in diagram)
- Enterprise Architect 7. or later
- NET Framework 3.5 or later
- Windows rights for instalation
- Download Windows Installer
- DiagrIsComplete.msi installieren
- Installer installs DiagrIsComplete as a Enterprise Architect Addin
- EA, Restart, Addins, Manage Addins, Check 'Load on Startup'
- You may explore functionality with attached EA model
- Deinstallation like standard Windows
- 'Set completeness markers..' sets the completeness markers for the choosen diagrams or all diagrams
- 'Reset completeness markers..' resets the completeness markers for the choosen diagrams or all diagrams
- 'Help' a short help
- The functions Set / Reset work on
- Selected Diagram
- Selected Package and all the diagrams contained in Package or Subpackages(recursive)
- All diagrams of the model
The command 'Set completeness markers' modifes the diagram:
The classifier has 'bold' border if: Classifier is visualized in diagram with all associations of the model.
The classifier has 'standard' border if: Classifier is visualized in diagram with all associations of the diagram (no hidden associations).
The classifier has 'red' border if: Classifier is visualized in diagram with hidden associations.