EA Mapping tool the next steps

Since my last post EA mapping EA Mapping Tool => Who wants it? there has been quite some response.

There are at least three parties that are seriously committed in joining, and a number of parties that are interested but for any number of reasons aren’t able to commit to anything just yet.

So the next logical step in the process is start building a requirements list. I’ve started with list of basis requirements listed below. Every sponsor now will now be given the opportunity to review those requirements and add some of their own.

If your organisation is still in doubt maybe this list of requirements will help you to get them convinced of the usefulness of this add-in. There is still time to join in as a sponsor.

The requirements

I’ve divided the requirements into three categories: base, GUI and exchange. Below there’s a detailed list of these requirements.

Base Requirements

RQ001 The tool should be able to map an attribute to one or more attributes or associations
RQ002 The tool should be able to map one association to one or more associations or Attributes
RQ003 For each mapping between (possibly) multiple attributes and association the tool should be able to document a mapping logic
RQ004 Mapping logic should be re-usable between mappings
RQ005 The tool should be able to use either RefGUID tagged values or “link to element features” or a combination thereof to make the link between attributes.
RQ006 A mapping should be able to depend on the “path” of the attribute. Contract.Seller.Name may be mapped to another attribute then Contract.Buyer.Name, although both are Party.Name.
RQ007 All mapping informatio is stored inside an Enterprise Architect model

GUI Requirements

RQ010 The tool should represent one model at one side and the other model at the other side,showing the links in a visual obvious way
RQ011 If a mapping logic is applied this should be visually apparent.
RQ012 The mapping logic should be easily accessible from the GUI
RQ013 It should be possible create or change mappings in a very intuitive way, such as drag and drop.
RQ014 The tool should be able to filter only the mapped items from both data model in order to not clutter the user interface with unused items.
RQ015 The GUI should be entirely in Enteprise Architect and the main mapping window should use the “diagram” space of EA.

Mockup

Visually the GUI should look somewhat like this

mapping tool

Exchange requirements

RQ020 The tool should be able to import mappings from a CVS file
RQ021 The tool should be able to export mappings to a CSV file

Download

Of course all of these requirements where modeled in EA and you can download the initial requirement model below.

[ecwid_product store_id=”6824265″ product_id=”71957048″]

Join us

If you feel these requirements are a good fit to your requirements for a mapping tools send me a message at geert@bellekens.com and you may still join this community driven initiative.

EA Mapping tool => Who wants it?

I’m thinking about developing a mapping tool add-in for EA.
The idea is that you can manage a mapping between two types of (data) models. For example between your logical data model and your message model, or between your logical data model and your database model etc…

I already have a number of add-ins and scripts that somehow create traceability between models on element, attribute and association level, but I don’t have a tool yet to visualize and manage those traces.

To give you an idea the GUI of the thing could look similar to this:

mapping tool
Functions could include
– ability to add notes to each mapping
– ability to export the mapping to excel
– drag-n-drop to create mappings
– …
Now it seems to me like there could be many parties interested in such a tool.
I would like to develop this as a free and open source add-in (as I do for all my add-ins) but I’m still looking for sponsors.
My initial rough estimate for the development of such a tool is 15 man days.

I already have two parties that might be interested, but the more sponsors I can find the lower the price would get for each individual party.

So if you are interested in such a tool please let me know: geert@bellekens.com and we might be able to work something out.

Presenting the new open source Enterprise Architect Shapescript Library

The new open source Enterprise Architect Shapescript Library in Github is an initiative to share shapescripts for Enterprise Architect within the user community.

Shapescripts in Enterprise Architect are used to define the presentation of elements on a diagram. They are mostly used when defining a UML profile in Enterprise Architect that extends UML or another modelling language with project specific elements and properties.

Shapescript examples

When developing UML profiles these shapescripts are stored in the _image attribute on the stereotype element, an they can be easily edited using the profile helper.

Shapescript editor

After a while however you’ll have a bunch of shapescripts scattered over different profiles, and projects, and it becomes hard to manage, or do any kind of version control. Finding a specific shapescript where you used a particular feature is next to impossible if you don’t remember exactly which stereotype this shapescript belonged to.

Exporting shapescripts

With the shapescript editor you can export each shapescript individually, but once you have more then a couple of shapescripts that quickly becomes a drag to save your shapescripts to files.

So I wrote a script called ExportAllShapeScripts that searches a repository for all stereotypes that have a shapescript, and exports all of these shapescripts in one go.

This script is part of the Enterprise-Architect-VBScript-Library. Read the article How to use the Enterprise Architect VBScript Library for instructions on downloading and using the Library in Enterprise Architect.

Running this script will save each shapescript as a textfile with extension .shapeScript, grouped in packages per profile.

Shapescripts saved

The code explained

The export script first uses an SQL query to find all shapescripts. Technically the shapescripts are stored in the default property of the attribute with the name _image. The script is stored as an xml tag Image in a zipped and base64 encoded format. A typical shapescript might look like this in the database:

<Image type="EAShapeScript 1.0" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">
UEsDBBQAAAAIABpRIkdk2qflMQIAADIHAAAHABEAc3RyLmRhdFVUDQAHncrmVZ3K5lWdyuZV
jVXJTsMwFJxrkfiHCC5FqsRSaIsQhx44sohKcC5toUihqUjYxb8z8xw3jksLsmIn9sx43vOS
HFMMMccECZ749ogZNrGBL6sbSNn3gQwvKFg+DHmKLfZPcM+eZzIeqFGw76Tk3LPvneNj9JEb
Y8TxayoVHMmML+YLRyqWq8emmxP3ybcmuthDC222OyXS4fpEjjGgxh1rH0OTejP2PbF3whly
frewTw2puDbUcVp5kIM62437XHiPDeyy3FnkCXEuviG5D5YXjxrwvcAV6xluiR7za0qP7YUH
oa6X+E1zWzmOncdObsytcjuiSkpPqa3jZBFBgzFleDU/GcfloW1zhJqeJYxHLM8cK3VY1is5
xLJSGINW+5lo33dGDanMGYMyInYLB+hZLWddtqvUMpv9N8dNHJKnHdVZ4/hoMdtfmNhFPNdv
TmMdZSfGhNEUeAsy02eeRnYyuuZR7GPmp1U66lmODlmkKkwca91jj2zh1+XD6cQe6xjnIcbU
45gaI2Gb2c3xaSulvR/uWs9ZdX7210SjDCgPq336MxWjQqe53YXagQnPeWa3WXWWtCMLu+WE
GHE8tXiqc1tXXr4hHNKtkR7tgb8YB+U6Ca8V/R+rY7vdsTqm8B/Wsek7VpWvOi9ufXHf39bq
qd70KLvujteaPML9EbQnMvYldKF9MLQbODVGeDvXR76sTsr1uCz/RdLVf2Bgd391yyUlem44
7bq0RG7jgqfqnHfONr8qbN25f34AUEsBAhcLFAAAAAgAGlEiR2Tap+UxAgAAMgcAAAcACQAA
AAAAAAAAAACAAAAAAHN0ci5kYXRVVAUAB53K5lVQSwUGAAAAAAEAAQA+AAAAZwIAAAAA
</Image>

So the SQL selects all attributes owned by a element with stereotype «stereotype» with the name _image that have the tag <Image>  in their Default field.

'get all attributes with name _image that have shapescript in the default field and a parent with stereotype «stereotype»
dim sqlGetShapescriptAttributes
sqlGetShapescriptAttributes = "select a.ID from (t_attribute a " & _
							  " inner join t_object o on (o.Object_ID = a.Object_ID " & _
							  "						and o.Stereotype = 'stereotype')) " & _
							  " where a.Name = '_image' " & _
							  " and a.[Default] like '<Image type=""EAShapeScript" & getWC & "'"
dim shapeScriptAttributes
set shapeScriptAttributes = getAttributesByQuery(sqlGetShapescriptAttributes)

Then we loop the schapescript attributes, decode the shapescript and save it as an individual text file.

'loop the shape script attributes
for each shapeScriptAttribute in shapeScriptAttributes
	'get the stereotype
	dim stereotype as EA.Element
	set stereotype = Repository.GetElementByID(shapeScriptAttribute.ParentID)
	dim profile as EA.Package
	set profile = findProfilePackage(stereotype)
	'load the resultset in the xml document
	dim shapeScript
	shapeScript = decodeBase64zippedXML(shapeScriptAttribute.Default,"Image")
	if len(shapeScript) > 0 then
		dim scriptFile
		set scriptFile = New TextFile
		scriptfile.Contents = shapeScript
		'save the script
		scriptFile.FullPath = selectedFolder.FullPath & "\" & profile.Name & "\" & stereotype.Name & ".shapeScript"
		scriptFile.Save
		'debug info
		Session.Output "saving script: " & scriptFile.FullPath
	end if
next

The real difficulty int his script was to decode the shapescript, which is hidden in the method decodeBase64zippedXML  defined in the XML utility script. It first base64 decodes the contents of the tag, then saves it as a zip file, unzips the zip file, gets the text file in the zip file, and returns the contents of the text file. Then it deletes the temporary zip file and folder it was extracted to.

 Contributing

If you have shapescripts of your own that you wish to share you can send a github pull request, or an email to geert@bellekens.com.

Any bright ideas on how to document each of the shapescripts with an image of shape are welcome too.

 

The Bellekens EA Toolpack combines EA-Matic, EA Navigator and ECDM Message Composer

The three free and open source add-ins for Enterprise Architect : EA Navigator, EA-Matic and ECDM Message Composer have been combined in a convenient package called Bellekens EA Toolpack.

Bellekens EA Toolpack

Downloading any of the add-ins from the site now gets you an installer for the Bellekens EA Toolpack. With this installer you can install all three add-ins, or only the ones you require.

Bellekens EA Toolpack installer

The main reason for this change is the shared EA Addin Framework. Because all three add-ins use the same framework, there was a risk at version conflicts when two add-ins were installed on the same machine because each add-in installed its own version of the framework. With the new installer the framework gets installed only once thus avoiding any possible version conflicts which are known as the DLL Hell.

An added benefit of the Bellekens EA Toolpack is the fact that is now installs the applications for all users on the machine, making it easier to distribute in a corporate organisation.

Because the Bellekens EA Toolpack is a different application from Windows point of view you’ll have to uninstall any versions of EA Navigator, EA-Matic or ECDM Message Composer you might have installed previously. Uninstalling is the easiest from the add/remove programs feature in the control panel.

See Also

Download

[ecwid_product store_id=”6824265″ product_id=”48049803″]

How to use the Enterprise Architect VBScript Library

The Enterprise Architect VBScript Library is an open source library of VBScripts written to be used in  Enterprise Architect.

This article explains how to download, import and use the library in Enterprise Architect.

Initial Import

Initial scripts

The Enterprise Architect VBScript Library contains some scripts to load and save scripts from/to your file system, but before we can use those we have to import an initial set of scripts to get started.

After downloading the file select menu option Project|Data Management|Import Reference Data and choose the downloaded file. Make sure to select Automation scripts and click Import.

This will import the minimum set of scripts required to load other scripts from the file system

 

 

[ecwid_product store_id=”6824265″ product_id=”58361080″]

Download library from GitHub

From the Enterprise Architect VBScript Library project page on GitHub you can either choose to download the library as a zip file, or download the repository in GitHub desktop.

VBScript library github

Load library into Enterprise Architect

Select scripts folderOne of the scripts in the initial set is the script LoadScripts in the group Script Management. If you execute this script you can choose the library folder from the library downloaded from GitHub.

The script will then scan the entire folder tree and it will load any .vbs file it can find.

For starters it might be interesting to only load the Frameworks scripts as they have the most chance of being useful to anyone.

If the LoadScripts script finds a script that already exists in Enterprise Architect it will ask to overwrite the existing scripts.

In order to know in which group the script belongs it will look for a the group indicator in the script.

'[group=Script Management]

This will tell the script that this script should go in the group Script Management. If the script indicator is absent it will assume the group name is the name of the folder where it was found.

After loading the scripts into EA make sure to press the refresh button to make the scripts appear in the GUI.

Refresh script tree

Saving all your scripts

In the script management group there also a script to save all your scripts to the file system.

In order to control where the script should go you can add the path indicator to the script like this

'[path=\Framework\Tools\Script Management]

The path indicator will control where to place the script relative to the chosen folder.

If the path indicator is absent the name of the script group will be used as name of the folder.

Being able to save and load the scripts from/to the file system now allows us to use version control on these scripts.

The library structure

The library is structured in two main parts.

  • Projects
    Contains an assortment of various scripts written for various projects.
  • Framework
    Contains the framework scripts that are meant to be used by other scripts

    • Utils
      Contains helper scripts and classes such as TextFile, SQL, XML etc..
    • Wrappers
      Contains the wrapper classes for EA elements such as TaggedValue, Script, ScriptGroup

The scripts in the projects folder can be used for inspiration, but it is mainly the scripts int he Framework part that are useful when writing scripts.

Using the library

The first thing you need to do when you want to use any of the framework classes is to include the framework in your script

!INC Wrappers.Include

This will include the “Include” script that takes care of including all the other scripts of the framework, including those of the Utils folder.

Then you can use the classes defined in the library. For example, if you want to have the user select a directory you can use following code

'get the folder from the user
dim folder
set folder = new FileSystemFolder
set folder = folder.getUserSelectedFolder("")

The classes in the library contain both properties as operations. You can use the properties as you would expect from “real” classes.

'show messagebox with the name of each subfolder
dim subfolders, subfolder
for each subfolder in folder.SubFolders
    msgbox "subfolder name: " & subfolder.Name
next

Contributing

Have you written any VBScripts for Enterprise Architect you would like to share? If you would like to contribute to the Enterprise Architect VBScript library you can email me at geert@bellekens.com

EA Navigator 1.1 released

Attention! A more recent version of the EA Navigator is currently available.
See EA Navigator Downloads

The EA Navigator is a free and open-source add-in for Sparx Systems Enterprise Architect that allows for quick navigation between different elements in a model.

The EA Navigator is (currently the only) part of the Enterprise Architect Toolpack

EA Navigator 1.1 now navigates between:

  • Operations and Sequence diagrams
  • Types and Parameters
  • Types and Attributes

Prerequisites

Installation

Usage

Once installed there should be a new menu option Navigate in the Add-Ins menu.

If this option is not visible then there must have gone something wrong during the installation.

The EA Navigator will now show its functions depending on the type the element that is selected. You can either access its function using the main menu, or using the right-click context menu.

Below is a list of available functions depending on the type of the selected element

Operation

  • Diagrams
    Shows all sequence diagrams that contain a message calling this operation.
  • Parameter Types
    Shows all types of the parameters of this operation.

Message (in sequence diagram)

  • Operation
    Select the called operation in the project browser.
  • Diagrams
    Shows the sequence diagrams for the called operation?
  • Parameter Types
    Shows the parameter types for the called operation

Classifier

  • Dependent Attributes
    Shows all attributes that use the selected classifier as type
  • Dependent Parameters
    Shows all parameters that use the selected classifier as type

Attribute

  • Type
    Selects the type of the attribute in the project browser

Open Diagrams dialog

When the function Diagrams is selected the Open Diagram dialog will open

From this dialog you can select the diagrams you wish to view and click the Open button to open the selected diagram in EA.

You can also double-click on a single diagram, which will also open the diagram.

Select Elements dialog

The Select Elements dialog will be shown if a list any other type of elements need to be shown.

Clicking the Select button, or double-clicking an element in the list will select that element in the project browser.
Elements that are grayed-out are non-selectable elements such as primitives.

Other Resources

UML and Enterprise Architect Tools open-sourced at GitHub

The last few days I published some of my side-projects to GitHub.

I created three repositories

There’s still a lot to do, like adding documentation and installers etc, but it’s a start.

One of those things I’m thinking about is which open source license I should use. Any motivated suggestions are welcome 🙂