Clinique ArchiMate case study



Resources
Headlines
CliniqueArchiMate

ArchiMate ⤳ “Active structure” ⤳ strategy layer

ArchiMate ⤳ “Active structure” ⤳ business layer

ArchiMate ⤳ “Behavior” ⤳ business layer

ArchiMate ⤳ “Passive structure” ⤳ business layer

ArchiMate ⤳ “Product” ⤳ business layer

ArchiMate ⤳ “Active structure” ⤳ application layer

ArchiMate ⤳ “Behavior” ⤳ application layer

ArchiMate ⤳ “Passive structure” ⤳ application layer

Exercise

Solution

Documentation ⤳ upstream (Enterprise Architect)

Model Library

Exercise

GlossaryPublishing perspective

Glossary ⤳ creation here

Glossary ⤳ terms as classes in UML Class Diagram

Glossary ⤳ term types, i.e., categories as packages in UML Package Diagram

Glossary ⤳ view here

Glossary ⤳ markup here

Exercise

  1. Add ArchiMate glossary category with Aspect, Layer… glossary entries. Possibly, define style of ArchiMate glossary category
  2. Publish Business package by means of Clinique Document Template (Markup Glossary Terms option)
Documentation ⤳ downstream (Enterprise Architect)

Report Builder

Linked Document here

Linked Document Template

Document Template here… and there

Document Template ⤳ content settings

Document Template ⤳ publication -package per package-

Template Fragment here

Template FragmentSQL here

Template Fragment within Document Template

Template Fragment within Document Template ⤳ publication

Template Fragment ⤳ scripting (don't forget custom > < custom)

Template Fragment ⤳ scripting cont'd

function Clinique(object_id) { // 'EA', 'Repository', 'Session'... are available objects...
	Session.Output("'Clinique' (JavaScript)... " + object_id); // Call with '#OBJECTID#'
	var object = Repository.GetElementByID(object_id);
	Session.Output("Package from which document generation occurs... " + object.Name);
	
	// API (https://sparxsystems.com/enterprise_architect_user_guide/16.1/add-ins___scripting/document_generator_interface_class.html):
	var reporting as EA.DocumentGenerator; // Intelli-sense type declaration
	reporting = CreateDocumentGenerator();
    if(reporting) {
		// Publish > Model Reports > Report Builder > Generate Documentation > Project Constants
		Session.Output("'reporting': " + reporting.GetProjectConstant("FranckBarbier"));
		reporting.InsertText(reporting.GetProjectConstant("FranckBarbier"), EA.TextAlignment.AlignLeft);
        if(reporting.NewDocument("")) {
			// Insert an external document into the currently generated file:
			if(reporting.LoadDocument("C:\\Users\\franc\\Desktop\\Data.rtf") === false)
				Session.Output("Error: " + reporting.GetLastError());
			// Effect of 'reporting.InsertText' is *CANCELED*!
			return reporting.GetDocumentAsRTF();
        }
    }
}

Project constants

Exercise

  1. Adapt Realizations Template Fragment from Clinique.qea project into Prison_de_Nantes.qea project
    • Settings Transfer -Model- Export Reference Data… -Reference Data-Realizations -Document Templates-
  2. Change Realizations name to Instantiations and adapt content to get instantiation relationships instead of realization relationships. Tip:
    SELECT SOURCE.Name || ' --IS INSTANCE OF--> ' || TARGET.Name AS is_instance_of FROM t_object as SOURCE, t_object as TARGET --SQLite!
    INNER JOIN t_connector as Instantiation
    ON SOURCE.Object_ID = Instantiation.Start_Object_ID AND TARGET.Object_ID = Instantiation.End_Object_ID
    WHERE Instantiation.Stereotype like 'instanceOf';
  3. Construct Document Template, which (re)-uses Instantiations Template Fragment
  4. Publish package(s)

Custom Document here… and there

Custom Document ⤳ creation

Custom Document ⤳ package's realization relationships

Custom Document ⤳ publication (.rtf, .html, etc.)

Exercise

  1. Create Template Fragment by adapting the Default system Template Fragment (remove contained General Relationship system Template Fragment and more…)
  2. Create Custom Document named Definitions by applying Glossary system Document Template
  3. Apply Template Fragment created in 1. as dynamic content to each item having GlossaryEntry stereotype in Business package having GlossaryCategory stereotype

Exercise ⤳ expected result

HTML ⤳ -package per package- here… and there

HTML Template Fragment

HTML ⤳ publication

Virtual Document here… and there

Virtual Document«report package» stereotype

Virtual DocumentModel Document

Virtual DocumentModel Document settings

Virtual Document ⤳ publication (Clinique Document Template)

Virtual Document ⤳ publication result (order: Strategy…)

Virtual Document ⤳ HTML

Exercise

Dynamic Document here

Dynamic Document Template

Data of an Enterprise Architect project are recorded and organized within a relational database. As a result, data may be handled through SQL statements, queries especially. This organization is known as the Object Model here

Object Model SQL tables with constants

Enterprise Architect comes with the Query Builder to avoid SQL. The Copy Search : Create a copy of a search button is an asset for adapting numerous predefined searches here… in varied search categories: Common Searches… with My Searches category devoted to custom searches.

Key action(s)

Search ⤳ in model

Search ⤳ in current package

SearchQuery Builder here

Object Model ⤳ “All diagrams”

Object Model ⤳ “All diagrams containing Application in Name column” (Query Builder)

Object Model ⤳ “All classes”

Searches are not part of Reference Data ⤳ exports and imports must be explicit

Object Model ⤳ simple queries

Get root package, i.e., the model itself

SELECT Name, Parent_ID FROM t_package WHERE Parent_ID = 0

Internally usable queries

SELECT ea_guid AS CLASSGUID, Name FROM t_package WHERE Parent_ID = 0
-- 'ea_guid' has to be returned to highlight package (model) within browser...

BPMN collaboration model(s)?

SELECT * FROM t_object WHERE Stereotype = 'CollaborationModel'
-- 'Object_Type' -> 'CollaborationModel' sur la base de la classification BPMN...
-- SELECT Name, Object_Type, Stereotype FROM t_object WHERE Stereotype = 'CollaborationModel'
-- 'Object_Type' -> 'Activity' sur la base de la classification UML...

Object Model ⤳ “Start and end classes of ArchiMate Assignment relationships”

SELECT Assignment.Stereotype, COALESCE(Assignment.Name,'-NO NAME-') 'Name of assignment', Start.Name AS _From_,
End.Name AS _To_ FROM t_object as Start, t_object as End -- 'COALESCE(x,y,...)' returns the first non 'NULL' parameter...
INNER JOIN t_connector as Assignment
ON Start.Object_ID = Assignment.Start_Object_ID AND End.Object_ID = Assignment.End_Object_ID
WHERE Assignment.Stereotype = 'ArchiMate_Assignment'

Object Model ⤳ “Start and end classes of ArchiMate Serving associations”

SELECT Start.Name AS 'From', End.Name AS 'To' FROM t_object as Start, t_object as End
INNER JOIN t_connector as Serving_association
ON Start.Object_ID = Serving_association.Start_Object_ID AND End.Object_ID = Serving_association.End_Object_ID
WHERE Serving_association.Connector_Type in ('Association','Aggregation', 'Composition') -- 'Association' is enough...
AND Serving_association.Stereotype = 'ArchiMate_Serving'

Object Model ⤳ “packages# in under-root Business package”

Note: robust criterion for root package, i.e., “model” is SELECT * FROM t_package AS Root WHERE Root.Parent_ID = 0

SELECT COUNT(*) AS Total FROM t_package AS Business_sub_package
INNER JOIN t_package AS Business_package
ON Business_sub_package.Parent_ID = Business_package.Package_ID
WHERE Business_package.Name = 'Business' AND Business_package.Parent_ID = 1 -- 'Business' package under root...

Object Model ⤳ “diagrams in under-root Business package”

SELECT D.Name, D.Package_ID as Owner FROM t_diagram AS D
INNER JOIN t_package AS Business_package
ON Owner = Business_package.Package_ID AND Business_package.Name = 'Business' AND Business_package.Parent_ID = 1
-- Tous les diagrammes juste sous 'Business' lui-même juste sous 'root' -> rien !
SELECT D.Name, D.Package_ID as Owner FROM t_diagram AS D
INNER JOIN t_package AS Business_package, t_package AS Business_sub_package
ON Owner = Business_sub_package.Package_ID
AND Business_sub_package.Parent_ID = Business_package.Package_ID
AND Business_package.Name = 'Business' AND Business_package.Parent_ID = 1
-- Tous les diagrammes sous (récursivement) les sous-packages de 'Business' lui-même
-- juste sous 'root' -> 4 'Name - Owner'

Object Model ⤳ macro-statement here

SELECT COUNT(*) AS Total FROM t_diagram AS D
INNER JOIN t_package AS Business_package,
    t_package AS Business_sub_package
ON D.Package_ID = Business_sub_package.Package_ID
AND Business_sub_package.Parent_ID = Business_package.Package_ID
AND Business_package.Package_ID = #Package#
AND Business_package.Parent_ID = 1
-- #Package# est le package actif dans le browser au moment
-- de la requête

Object Modelx_ref SQL table here

SELECT P.Name, Additional_data.Description FROM t_xref AS Additional_data -- Les références externes du projet
INNER JOIN t_package AS P
ON Additional_data.Client = P.ea_guid -- Quels sont les packages ayant des info. additionnelles ?

Exercise

ArchiMate Realization relationships? ⤳ t_connector

SELECT Connector_Type, Stereotype FROM t_connector
WHERE Connector_Type = 'Dependency' AND Stereotype = 'ArchiMate_Realization'
-- La condition sur le stéréotype seul suffit :
-- SELECT Connector_Type, Stereotype FROM t_connector WHERE Connector_Type in ('Realization')

Packages whose status is not Approved? ⤳ t_object

SELECT Object_Type, Name, Status FROM t_object
WHERE Object_Type = 'Package' AND Status <> 'Approved'

View: property of ArchiMate diagrams (-right click- (diagram within browser) Properties…View:)? ⤳ t_diagram

SELECT Name FROM t_diagram WHERE StyleEx
LIKE '%MDGDgm=ArchiMate3::Business;MDGView=ArchiMate 3 Basic::Business Process Cooperation%'

Terms of glossary? ⤳ t_glossary

SELECT Name AS Word, Note AS Signification FROM t_object
WHERE Stereotype = 'GlossaryEntry'
UNION
SELECT Term AS Word, Meaning AS Signification FROM t_glossary