Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Common include for PlantUML scripts to define ArchiMate concepts
@startuml Common
' PlantUML ArchiMate Sequence Diagram template v5
' Changelog:
' v3 Updated for new PreProcessor
' v4 Function to Procedure
' v5 Added Motivation, migrated to Styles, added Structure type
' Author: Steven Mileham (steven.mileham@gmail.com)
skinparam dpi 150
skinparam useBetaStyle true
<style>
sequenceDiagram {
LineColor black
shadowing 0
FontName "Roboto"
Box {
LineColor Gray
BackgroundColor #f2f2f2
Padding 10
}
Lifeline {
LineColor DimGray
BackgroundColor LightGray
}
.Business {
LineColor #GoldenRod
BackgroundColor #Business
}
.Application {
LineColor #LightSteelBlue
BackgroundColor #Application
}
.Technology {
LineColor #LimeGreen
BackgroundColor #Technology
}
.Physical {
LineColor #LimeGreen
BackgroundColor #Technology
}
.Motivation {
LineColor #Purple
BackgroundColor #Motivation
}
.active {
}
.behavior {
RoundCorner 10
}
.passive {}
.motive {
DiagonalCorner 10
}
}
</style>
' Archimate Components
' Generic
!procedure $element($layer,$type,$structure,$label,$name="")
!if ($name=="")
participant "<$archimate/$type>\r $label" as $label << $layer >> << $structure >>
!else
participant "<$archimate/$type>\r $label" as $name << $layer >> << $structure >>
!endif
!endprocedure
' Motivation
!procedure $driver($label,$name="")
$element("Motivation", "driver","motive", $label, $name)
!endprocedure
!procedure $assessment($label,$name="")
$element("Motivation", "assessment","motive", $label, $name)
!endprocedure
!procedure $goal($label,$name="")
$element("Motivation", "goal","motive", $label, $name)
!endprocedure
!procedure $outcome($label,$name="")
$element("Motivation", "motivation-outcome","motive", $label, $name)
!endprocedure
!procedure $principle($label,$name="")
$element("Motivation", "principle","motive", $label, $name)
!endprocedure
!procedure $requirement($label,$name="")
$element("Motivation", "requirement","motive", $label, $name)
!endprocedure
!procedure $constraint($label,$name="")
$element("Motivation", "constraint","motive", $label, $name)
!endprocedure
!procedure $value($label,$name="")
$element("Motivation", "value","passive", $label, $name)
!endprocedure
!procedure $meaning($label,$name="")
$element("Motivation", "meaning","passive", $label, $name)
!endprocedure
!procedure $stakeholder($label,$name="")
$element("Motivation", "role","motive", $label, $name)
!endprocedure
' Business
!procedure $businessActor($label,$name="")
$element("Business", "actor","active", $label, $name)
!endprocedure
!procedure $businessCollaboration($label,$name="")
$element("Business", "collaboration","active", $label, $name)
!endprocedure
!procedure $businessEvent($label,$name="")
$element("Business", "event","behavior", $label, $name)
!endprocedure
!procedure $businessInteraction($label,$name="")
$element("Business","interaction","behavior", $label, $name)
!endprocedure
!procedure $businessInterface($label,$name="")
$element("Business","interface","active", $label, $name)
!endprocedure
!procedure $businessObject($label,$name="")
$element("Business","object","passive", $label, $name)
!endprocedure
!procedure $businessProcess($label,$name="")
$element("Business","process","behavior", $label, $name)
!endprocedure
!procedure $businessRole($label,$name="")
$element("Business","role","behavior", $label, $name)
!endprocedure
!procedure $businessService($label,$name="")
$element("Business","service","behavior", $label, $name)
!endprocedure
!procedure $contract($label,$name="")
$element("Business","contract","passive", $label, $name)
!endprocedure
!procedure $product($label,$name="")
$element("Business","product","passive", $label, $name)
!endprocedure
!procedure $representation($label,$name="")
$element("Business","representation","passive", $label, $name)
!endprocedure
' Application
!procedure $applicationCollaboration($label,$name="")
$element("Application","collaboration","active", $label, $name)
!endprocedure
!procedure $applicationComponent($label,$name="")
$element("Application","component","active", $label, $name)
!endprocedure
!procedure $applicationEvent($label,$name="")
$element("Application","event","behavior", $label, $name)
!endprocedure
!procedure $applicationFunction($label,$name="")
$element("Application","function","behavior", $label, $name)
!endprocedure
!procedure $applicationInteraction($label,$name="")
$element("Application","interaction","behavior", $label, $name)
!endprocedure
!procedure $applicationInterface($label,$name="")
$element("Application","interface","active", $label, $name)
!endprocedure
!procedure $applicationProcess($label,$name="")
$element("Application","process","behavior", $label, $name)
!endprocedure
!procedure $applicationService($label,$name="")
$element("Application","service","behavior", $label, $name)
!endprocedure
!procedure $dataObject($label,$name="")
$element("Application","object","passive", $label, $name)
!endprocedure
' Technology
!procedure $artifact($label,$name="")
$element("Technology","technology-artifact","passive", $label, $name)
!endprocedure
!procedure $communicationNetwork($label,$name="")
$element("Technology","network","active", $label, $name)
!endprocedure
!procedure $device($label,$name="")
$element("Technology","device","active", $label, $name)
!endprocedure
!procedure $node($label,$name="")
$element("Technology","node","active", $label, $name)
!endprocedure
!procedure $path($label,$name="")
$element("Technology","technology-communication-path","active", $label, $name)
!endprocedure
!procedure $systemSoftware($label,$name="")
$element("Technology","system-software","active", $label, $name)
!endprocedure
!procedure $technologyCollaboration($label,$name="")
$element("Technology","collaboration","active", $label, $name)
!endprocedure
!procedure $technologyEvent($label,$name="")
$element("Technology","event","behavior", $label, $name)
!endprocedure
!procedure $technologyFunction($label,$name="")
$element("Technology","function","behavior", $label, $name)
!endprocedure
!procedure $technologyInteraction($label,$name="")
$element("Technology","interaction","behavior", $label, $name)
!endprocedure
!procedure $technologyInterface($label,$name="")
$element("Technology","interface","active", $label, $name)
!endprocedure
!procedure $technologyProcess($label,$name="")
$element("Technology","process","behavior", $label, $name)
!endprocedure
!procedure $technologyService($label,$name="")
$element("Technology","service","behavior", $label, $name)
!endprocedure
' Physical
!procedure $distributionNetwork($label,$name="")
$element("Physical","physical-distribution-network","active", $label, $name)
!endprocedure
!procedure $equipment($label,$name="")
$element("Physical","physical-equipment","active", $label, $name)
!endprocedure
!procedure $facility($label,$name="")
$element("Physical","physical-facility","active", $label, $name)
!endprocedure
!procedure $material($label,$name="")
$element("Physical","physical-material","passive", $label, $name)
!endprocedure
' Notes
!procedure $assume($text, $placement = "left", $component = "")
hnote $placement $component #FFAAAA: <&warning> $text
!endprocedure
!procedure $document($text, $placement = "left", $component = "")
note $placement $component #FFFFA5: <&document> $text
!endprocedure
!procedure $question($text, $placement = "left", $component = "")
rnote $placement $component #FFBF00: <&question-mark> $text
!endprocedure
!procedure $schedule($text, $placement = "left", $component = "")
rnote $placement $component #98FB98: <&timer> $text
!endprocedure
!procedure $change($text, $placement = "left", $component = "")
rnote $placement $component #FFBF00: <&circle-check> $text
!endprocedure
!procedure $reuse($text, $placement = "left", $component = "")
rnote $placement $component #98FB98: <&circle-check> $text
!endprocedure
!procedure $error($text, $placement = "left", $component = "")
rnote $placement $component #FFCCCB: <&bug> $text
!endprocedure
hide stereotype
footer Generated on %date()
@enduml
@smileham

This comment has been minimized.

Copy link
Owner Author

@smileham smileham commented Dec 4, 2020

Fixed issue with Motivations, added Structure (Active, Passive, Behavior, Motive), Migrated to "Style" formatting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment