Displaying items by tag: model views

Saturday, 25 November 2017 06:00

ArchiMate Search helper in EA

Introduction

One of the challenges of a teambased architecture repository based on the ArchiMate language is to reduce the number of duplicate entities. With duplicates I mean an Archimate concept with the same name and stereotype that has two or more instances in the repository.

Especially in large repositories with a complex project browser configuration and a large number of modellers the changes of duplicates are substantial. Therefore mostly a procedure is introduced based on the steps that a modeller has to do a repository search before he or she can actually add an element from the toolbox and modify it

Search

For searching for elements in the repository there is a search dialog availabe that opens by default in a simple common search that searches for a text in all the items. This works fine but has a number of limitations for an ArchiMate modeller:

  • The search is relatively slow
  • The modeller is not interested in the full content but only in ArchiMate elements of a specific type.

Luckily we can define our own searches in EA and an example of a ArchiMate specific search is shown bin the image below:

In this image you see that we can search for application components only and the list is by default sorted by objectname. This will help us in a later stage in user friendliness. The SQL statement is given below.

 

SELECT t_object.ea_guid AS CLASSGUID, t_object.name as ObjectName, t_object.Stereotype, ParentPkg.Name as ParentName, t_object.ModifiedDate, t_object.Author, t_object.[Version], t_object.[Alias], t_object.Object_Type as CLASSTYPE,t_object.Note as Notes FROM t_object, t_package as ParentPkg WHERE (t_object.name LIKE '#WC#[Search Term]#WC#' OR '[Search Term]'='') AND t_object.stereotype IN('ArchiMate_ApplicationComponent') AND t_object.Package_ID = ParentPkg.Package_ID ORDER BY t_object.Name

The trick is in two parts of the select statement:

  • The first one is that we filter on the stereotype of the element so we only see a limited number of elements based on that stereotype
  • The second is that we do a trick with the search term. We combine a search term search with a full search so you can see all the elements when the search term is empty

Model view

 

This helps us a lot in finding the relevant elements relatively fast however the search screen has a number of limitations in which selecting all the time the right query is relatively user unfriendly. However luckily Enterprise Architect has another screen for implementing this user friendly approach in a convenient way: the model view.

In the modelview you can define your own search view and link these views to a search in the search component of EA. See the picture below

In this screen you see a sample of a number of ArchiMate specific searches based on their stereotype. When you expand one of these searches you get the list of elements based on this stereotype. Since we have a combination of a keyword search and a full search (on the stereotype) the modeller can select the approach that best fits his needs. In the view you can select an element by typing in the first characters another option is to open the conext menu and go to the search function in EA and now we open the richt search immediately.

Download

For download of this solution or for downloading other scripts or add ons please visit the eaxpertise website.

Published in Community Resources
Thursday, 17 November 2016 10:04

Fast access to each diagram in Enterprise Architect

We have often to do with EA models we’ve never seen before. In such cases, you have either to click through the project tree (can be confusing and time-robbing) or you use some pre-defined Model Views.

The picture bellow shows how it could look like on your machine when you’ve read the article to the end.

Model Views - Diagrams

The feature could be very helpful also in other situations and we wonder why it’s used so rarely. Using Model Views you can create access points to any elements you want independently from its position in the project browser. It can be compared with database views if you are familiar with databases.

The only thing which is a bit annoying while creating a view, you have to create a model search first. If you use the Query Builder, the created search can be used as a basis for a view without any problems. In case the functionality of the Query Builder is insufficient and you need to create an SQL query, it has to fulfill some criteria. Within your query, you need to define three fields: CLASSGUID, CLASSTABLE and CLASSTYPE, as shown in the following example:

SELECT ea_guid AS CLASSGUID, 't_diagram' as CLASSTABLE, Diagram_Type AS CLASSTYPE, Name, [Version], Author, Stereotype, CreatedDate, Diagram_Type, ModifiedDate
FROM t_diagram
WHERE t_diagram.Diagram_Type = 'Statechart'
ORDER BY ModifiedDate ASC

Diagram Views help a lot to explore unknown projects. Thus, we have created views for all common diagram types.

Feel free to download and to use them: Searches and Views

First step – open Model Search / Find in Project dialog and import the xml file that contains the definition of searches:


Model Views - Import Searches

 

Second step – activate Model Views window and import the xml file that contains the definition of views:


Model Views - Import Views

Enjoy!

Published in Community Resources