Book a Demo

Author Topic: UML and ArchiMate together in a model  (Read 13904 times)

Model Trainer

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
UML and ArchiMate together in a model
« on: May 18, 2023, 11:10:55 pm »
Hello guys,
I have some questions about how to combine UML and ArchiMate in one model in the Sparx. We are going to model all the layers of the Enterprise Architecture, and started with applications and business capabilities diagrams. The other modeller used UML for making lists or catalogues of them (applications and capabilities), using generic elements such as objects and class types and then put them in packages. Since ArchiMate is more formal way to model an EA and also because of a lot of generic appearance and relationships in the current model, we are going to use ArchiMate besides UML. These are my questions:

1. Is ArchiMate compatible with UML? I mean can I connect different objects to ArchiMate components? for example a class type object in the UML to an Application Component?
2. Can I change the type of the elements in a diagram at once without needing to change them one by one and manually? For instance, now we have a diagram for out "IT Enablers" which contains of class type elements which are applications. I want to change all of the diagram elements to Application Component in ArchiMate. As you know it's not the matter of appearance but the context and structure.
3. When we use other meta models like what Prolaborate provided for the Togaf, how can we change all of the past models based on that?
I appreciate your time and consideration to my concerns.

Best

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: UML and ArchiMate together in a model
« Reply #1 on: May 19, 2023, 02:17:36 am »
1. In theory UML and ArchiMate are completely separate modelling languages, so connections are technically not allowed.

EA doesn't stop you (for now) to use trace or dependency relations between items of different languages.

What you could do is make your own variant of ArchiMate, and adding certain relations yourself (as well as tagged values you might need)

2. The only way to mass change elements is using a script. It's not that difficult. All you need to do is set the type to the correct base type (Class, Component,..-, and the StereotypeEx to the fully qualified stereotype (e.g. Archimate3::ApplicationComponent)

3. The same as 2. With a script.

Geert

Model Trainer

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #2 on: May 19, 2023, 02:48:31 am »
Hi Geert,

Thank you so much for your reply, I really appreciate that.

Just is it a good method to use UML to model EA layers, such as applications (mostly their catalogues), biz capabilities, and so on and then connect them or what would be a common, better methodology?
Can you please provide me with more explanation or maybe source or links to read about this: "What you could do is make your own variant of ArchiMate, and adding certain relations yourself (as well as tagged values you might need)".

Sorry I'm novice in the Sparx.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #3 on: May 19, 2023, 02:58:38 pm »
Marc Lankhorst the author of ArchiMate talks about this in his book and his blog. https://bizzdesign.com/blog/combining-archimate-3-0-with-other-standards-uml-sysml-erd/. I usually Mix ArchiMate, BPMN and UML with the philosophy of using ArchiMate primarily and if it doesn't support the next level of detail required to implement then use either BPMN or UML. For example I'll used ArchiMate Data Object as a conceptual model and UML as a Logical Model and Physical Model with attributes etc when going into the next level of detail.
I posted a message on this forum sometime ago with a script to change the types from one modelling language to another. If you can't find it let me know and I'll repost the script.
« Last Edit: May 19, 2023, 03:00:42 pm by Sunshine »
Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: UML and ArchiMate together in a model
« Reply #4 on: May 19, 2023, 04:39:38 pm »
Here's a script I use to convert models.
For the missing functions from the included scripts, see https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library

Code: [Select]
'[path=\Projects\Project EL\Conversion]
'[group=Conversion]
option explicit

!INC Local Scripts.EAConstants-VBScript
!INC Wrappers.Include
'
' Script Name: Convert Archimate Stereotypes
' Author: Geert Bellekens
' Purpose: Convert ArchiMate Capabilities from standard to Bellekens MDG
' Date: 2023-01-20
'
const outPutName = "Convert Model"


dim stereotypeMapping
set stereotypeMapping = CreateObject("Scripting.Dictionary")

dim taggedValuesMapping
set taggedValuesMapping = CreateObject("Scripting.Dictionary")
dim taggedValuesCopy
set taggedValuesCopy = CreateObject("Scripting.Dictionary")
'----------------CONFIGURATION---------------------------------------
'Stereotypes
stereotypeMapping.Add "ArchiMate3::ArchiMate_Capability", "Bellekens Modelling::ArchiMate_Capability"
stereotypeMapping.Add "ArchiMate3::ArchiMate_BusinessFunction", "Bellekens Modelling::ArchiMate_BusinessFunction"
stereotypeMapping.Add "ArchiMate3::ArchiMate_BusinessObject", "Bellekens Modelling::Bellekens_BIM_Class"
stereotypeMapping.Add "Class;<null>", "Bellekens Modelling::Bellekens_BIM_Class"
stereotypeMapping.Add "Attribute;<null>", "Bellekens Modelling::Bellekens_BIM_Attribute"
stereotypeMapping.Add "Association;<null>", "Bellekens Modelling::Bellekens_BIM_Association"
stereotypeMapping.Add "Aggregation;<null>", "Association;Bellekens Modelling::Bellekens_BIM_Association"
stereotypeMapping.Add "Bellekens Modelling::Bellekens_BIM_Association", "Association;Bellekens Modelling::Bellekens_BIM_Association" 'temporary
stereotypeMapping.Add "Logical;<null>", "Bellekens Modelling::BIM View"
stereotypeMapping.Add "Bellekens Modelling::BIM View", "Bellekens Modelling::BIM View" 'temporary
'TaggedValues (replace by)
taggedValuesMapping.Add "Capa Maturity", "Maturity"
taggedValuesMapping.Add "Capa Level", "Level"

'TaggedValues (copy value to)
taggedValuesCopy.Add "Maturity", "Maturity 2nd"
'----------------CONFIGURATION---------------------------------------

sub main
'reset output tab
Repository.CreateOutputTab outPutName
Repository.ClearOutput outPutName
Repository.EnsureOutputVisible outPutName
'report progress
Repository.WriteOutput outPutName, now() & " Starting " & outPutName, 0
'do the actual work
convertCapabilities()
'report progress
Repository.WriteOutput outPutName, now() & " Finished " & outPutName, 0
end sub

function convertCapabilities()
dim package as EA.Package
set package = Repository.GetTreeSelectedPackage
convertPackage package

end function

function convertPackage(package)
'report progress
Repository.WriteOutput outPutName, now() & " Processing '" & package.Name & "'", 0
'convert elements
dim element as EA.Element
for each element in package.Elements
convertElement element, -1
next
'process diagrams
convertDiagrams(package)
'process subPackages
dim subPackage as EA.Package
for each subPackage in package.Packages
convertPackage subPackage
next
end function

function convertElement(element, level)
dim mappingKey
if len(element.FQStereotype) > 0 then
mappingKey = element.FQStereotype
else
mappingKey = element.Type & ";<null>"
end if
dim userMessage
userMessage = " Converting element '" & element.Name & "'"
'convert the element
convertItem element, userMessage, mappingKey, level
'process attributes
dim attribute as EA.Attribute
for each attribute in element.Attributes
convertAttribute element, attribute
next
'process (outgoing) relations
dim connector as EA.Connector
for each connector in element.Connectors
if connector.ClientID = element.ElementID then
convertConnector element, connector
end if
next
'process diagrams
convertDiagrams(element)
'process subElements
dim subElement as EA.Element
for each subElement in element.Elements
convertElement subElement, level + 1
next
end function

function convertConnector(element, connector)
dim mappingKey
if len(connector.FQStereotype) > 0 then
mappingKey = connector.FQStereotype
else
mappingKey = connector.Type & ";<null>"
end if
dim userMessage
userMessage = " Converting connector '" & element.Name & "." & connector.Name & "'"
'convert the connector
convertItem connector, userMessage, mappingKey, ""
end function



function convertAttribute(element, attribute)
dim mappingKey
if len(attribute.FQStereotype) > 0 then
mappingKey = attribute.FQStereotype
else
mappingKey = "Attribute;<null>"
end if
dim userMessage
userMessage = " Converting attribute '" & element.Name & "." & attribute.Name & "'"
'convert the attribute
convertItem attribute, userMessage, mappingKey, ""
end function

function convertDiagrams(diagramOwner)
dim diagram as EA.Diagram
for each diagram in diagramOwner.Diagrams
'get mapping key
dim mappingKey
if len(diagram.MetaType) > 0 then
mappingKey = diagram.MetaType
else
mappingKey = diagram.Type & ";<null>"
end if
'convert
if stereotypeMapping.Exists(mappingKey) then
Repository.WriteOutput outPutName, now() & " Converting diagram '" & diagram.Name & "'", 0
dim styleEx
'hide connector stereotypes
styleEx = setValueForKey(diagram.StyleEx, "HideConnStereotype", "1")
'set view to empty
styleEx = setValueForKey(styleEx, "MDGView", "")
'disable fully scoped object names
styleEx = setValueForKey(styleEx, "NoFullScope", "1")

dim extendedStyle
'hide attribute stereotypes
extendedStyle = setValueForKey(diagram.ExtendedStyle, "HideStereo", "1")
'hide element stereotypes
extendedStyle = setValueForKey(extendedStyle, "HideEStereo", "1")

diagram.StyleEx = styleEx
diagram.ExtendedStyle = extendedStyle
diagram.MetaType = stereotypeMapping(mappingKey)
diagram.Update
end if
next
end function

function convertItem(item,  userMessage, mappingKey, level)
if stereotypeMapping.Exists(mappingKey) then
'report progress
Repository.WriteOutput outPutName, now() & userMessage, 0
dim dirty
dirty = false
'check if we have a type to convert to
dim mappingTarget
dim targetSteretoype
mappingTarget = stereotypeMapping(mappingKey)
if instr(mappingTarget, ";") > 0 then
'fix the aggregation direction if needed
'aggregation with Direction "Source -> Destination" don't have arrows.
'If we change the type to Association, they do, so we change Direction to Unspecified in order to remove the arrow
if item.ObjectType = otConnector then
if item.Type = "Aggregation" _
  and item.Direction = "Source -> Destination" then
item.Direction = "Unspecified"
dirty = true
end if
end if
'get type and stereotype
dim mappingTargetParts
mappingTargetParts = split(mappingTarget, ";")
if item.Type <> mappingTargetParts(0) then
item.Type = mappingTargetParts(0) 'type
dirty = true
end if
targetSteretoype= mappingTargetParts(1)
else
targetSteretoype = mappingTarget
end if
if item.FQStereotype <> targetSteretoype then
item.StereotypeEx = targetSteretoype 'stereotype
dirty = true
end if
if dirty then
item.Update
end if
'convert tagged values
convertTaggedValues item, level
end if
end function


function convertTaggedValues(element, level)
dim tag as EA.TaggedValue
for each tag in element.TaggedValues
dim convertedTag
'convert tags
if taggedValuesMapping.Exists(tag.Name) then
set convertedTag = getExistingOrNewTaggedValue(element, taggedValuesMapping(tag.Name))
convertedTag.Value = tag.Value
convertedTag.Update
deleteTag element, tag.Name
end if
'copy tag values
if taggedValuesCopy.Exists(tag.Name) then
set convertedTag = getExistingOrNewTaggedValue(element, taggedValuesCopy(tag.Name))
convertedTag.Value = tag.Value
convertedTag.Update
end if
'check level tag
if lcase(tag.Name) = "level" then
dim correctLevel
correctLevel = "L" & level
if not lcase(tag.Value) = lcase(correctLevel) then
if lcase(tag.Value) = "tbd" or len(tag.Value) = 0 then
tag.Value = correctLevel
tag.Update
else
'report issue
Repository.WriteOutput outPutName, now() & " ERROR: Level tag on '" & element.Name & "' with GUID '" & element.ElementGUID & "' is '" & tag.Value & "' and should be '" & correctLevel  & "'", 0
end if
end if
end if
next

end function

main

Geert

Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Re: UML and ArchiMate together in a model
« Reply #5 on: May 19, 2023, 07:31:12 pm »
When you connect several languages you are really defining a new one that is possibly also adding completely new concepts and not using some from the original one.
What we typically do is to define this language as Metamodel and the implement as a Sparx MDG. One very advanced example of this approach is the Digital Architecture Framework that is available on github.
Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python

Model Trainer

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #6 on: May 19, 2023, 11:08:51 pm »
Thank you so much guys.

I think I should search more to see how I can make Metamodels or MDG ones in the EA Sparx, as I don't have such knowledge now. If you can provide me with a source of learning it, it would be your favour to me.

Best Regards

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: UML and ArchiMate together in a model
« Reply #7 on: May 19, 2023, 11:30:46 pm »
Thank you so much guys.

I think I should search more to see how I can make Metamodels or MDG ones in the EA Sparx, as I don't have such knowledge now. If you can provide me with a source of learning it, it would be your favour to me.

Best Regards
This is where I learned it from:https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_frameworks/introduction_2.html

Geert

wivel

  • EA User
  • **
  • Posts: 243
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #8 on: May 19, 2023, 11:36:25 pm »
Hi

Before venturing into creating custom MDGs for combining modeling concepts, I would strongly recommend that you take a step back and figure out what it is you want to achieve and if, and how, it can be done using the already available concepts in EA, and agree on that within your team.

Custom MDGs are strong, but they require development and maintenance. There are already so many notations and concepts available within EA, that I, based on your original post, do not think you need an MDG. Have you considered reworking the UML parts into ArchiMate instead?

Henrik

Model Trainer

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #9 on: May 20, 2023, 12:01:48 am »
Thank you so much @Geert, I will go through that.
It's a good point to consider @wivel. What do you mean by "reworking the UML parts into ArchiMate"? You mean recall them into the models and diagrams of ArchiMate?
And the problem here is that for example about 500 elements (including Biz capabilities and apps) was modelled as generic UML types such as class or object, and they don't have any specific stereotype or layout understandable for other modelling stakeholders in the organization. What should we do with them?

wivel

  • EA User
  • **
  • Posts: 243
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #10 on: May 24, 2023, 03:20:09 am »
What I mean is to go with Sunshines suggestion, since it is more or less the same way I work. Primarily use ArchiMate and mix, or rather. enhance it with BPMN and UML when you need to go into a level of detail not provided by ArchiMate.

When it comes to the work already done in UML that matches ArchiMate artefacts, I would convert it into ArchiMate either by redoing it manually or by scripting. I cannot tell which approach that is best suited for you.

As for building your own MDG's, my recommendation is to use EA 'out of the box' as much as possible. Custom MDG's require skills to develop and maintain, so use it only as a last resort.

Hope it makes sense.

Henrik

DeBAAT

  • EA User
  • **
  • Posts: 64
  • Karma: +2/-0
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #11 on: May 25, 2023, 04:38:06 pm »
I tend to use the same philosophy as in using ArchiMate where possible and only use BPMN and UML when needed.

Quote
When it comes to the work already done in UML that matches ArchiMate artefacts, I would convert it into ArchiMate either by redoing it manually or by scripting. I cannot tell which approach that is best suited for you.

For this trick, I use the export/importer from Geert:
  • Put all UML elements to migrate in a package, optionally layered when needed.
  • Export all elements
  • Change the stereotype of the UML elements to match the ArchiMate types
  • Import all elements using the update option to change the attributes of each element
If necessary, I manually create a dummy ArchiMate element for each stereotype to get the correct definitions to change the UML elements to.

Model Trainer

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #12 on: May 25, 2023, 10:48:36 pm »
Hello DeBAAT,

Thanks for your comment. I want to know if when you export all the elements in UML and then import them to update their specifications, the connections between elements would be changed? or even deleted? And should I make these connection again after updating? Did you face such a problem?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #13 on: May 26, 2023, 02:26:14 am »
This is safe since GUIDs are used to connect elements.

q.

Model Trainer

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: UML and ArchiMate together in a model
« Reply #14 on: May 26, 2023, 02:52:56 am »
Ok, then where can I find GUIDs or IDs specified for each element?