PlantUML Language Reference Guide
PlantUML Language Reference Guide
PlantUML es un proyecto Open Source (código abierto) que permite escribir rápidamente:
• Diagramas de Secuencia
• Diagramas de Casos de uso
• Diagramas de Clases
• Diagramas de Actividades
• Diagramas de Componentes
• Diagramas de Estados
• Diagramas de Objetos
• Diagramas de Despliegue
• Timing diagram
Los siguientes diagramas no-UML también están soportados:
• Wireframe graphical interface
• Archimate diagram
• Specification and Description Language (SDL)
• Ditaa diagram
• Diagrama de Gantt
• MindMap diagram
• Work Breakdown Structure diagram
• Mathematic with AsciiMath or JLaTeXMath notation
Los diagramas son definidos usando un lenguaje simple e intuitivo.
1 DIAGRAMA DE SECUENCIA
1 Diagrama de Secuencia
@enduml
You can use the orderkeyword to custom the print order of participant.
@startuml
participant Last order 30
participant Middle order 20
participant First order 10
@enduml
1.4 Auto-Mensaje
Un participante puede enviar mensajes asi mismo.
También es posible tener un mensaje multi-líneas usando \n.
@startuml
Alice->Alice: This is a signal to self.\nIt also demonstrates\nmultiline \ntext
@enduml
Puedes especificar un número de comienzo con autonumber número inicial , y también un incremento con
autonumber número inicial incremento.
@startuml
autonumber
Bob -> Alice : Authentication Request
Bob <- Alice : Authentication Response
autonumber 15
Bob -> Alice : Another authentication Request
Bob <- Alice : Another authentication Response
autonumber 40 10
Bob -> Alice : Yet another authentication Request
Bob <- Alice : Yet another authentication Response
@enduml
autonumber 15 "<b>(<u>##</u>)"
Bob -> Alice : Another authentication Request
Bob <- Alice : Another authentication Response
@enduml
También puedes usar autonumber stop y autonumber resume increment format para pausar y continuar
la numeración automática, respectivamente.
@startuml
autonumber 10 10 "<b>[000]"
Bob -> Alice : Authentication Request
Bob <- Alice : Authentication Response
autonumber stop
Bob -> Alice : dummy
autonumber stop
Bob -> Alice : dummy
@enduml
newpage
end
@enduml
Bob->Alice : ok
note right: this is another note
Bob->Bob : I am thinking
note left
a note
can also be defined
on several lines
end note
@enduml
note over Alice, Bob #FFAAAA: This is displayed\n over Bob and Alice.
endrnote
@enduml
1.15 Divisor
Si quieres, puedes dividir un diagrama usando el separador == para separar su diagrama en pasos lógicos.
@startuml
== Initialization ==
== Repetition ==
@enduml
1.16 Referencia
Puedes referenciar en un diagrama utilizando la palabra clave ref over.
@startuml
participant Alice
actor Bob
1.17 Retardo
Puedes usar ... para indicar un retardo en el diagrama. Y también es posible colocar un mensaje con ese retardo.
@startuml
@enduml
1.18 Espaciado
Puedes usar ||| para indicar espaciado en el diagrama.
También es posible especificar un número de píxel para ser usado.
@startuml
@enduml
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: RequestCreated
deactivate B
@enduml
Puede usarse anidamiento de líneas de vida, y es posible agregar un color a dicha línea de vida.
@startuml
participant User
B --> A: RequestCreated
deactivate B
deactivate A
A -> User: Done
deactivate A
@enduml
1.20 Return
A new command return for generating a return message with optional text label. The point returned to is the point
that cause the most recently activated life-line. The syntax is simply return label where label, if provided, can be
any string acceptable on conventional messages.
@startuml
Bob -> Alice : hello
activate Alice
Alice -> Alice : some action
return bye
@enduml
create Other
Alice -> Other : new
@enduml
activate A
A<--] : RequestCreated
deactivate A
[<- A: Done
deactivate A
@enduml
[o-> Bob
[o->o Bob
[x-> Bob
[<- Bob
[x<- Bob
Bob ->]
Bob ->o]
Bob o->o]
Bob ->x]
Bob <-]
Bob x<-]
@enduml
@enduml
Por defecto, guillemet (comillas) son usadas para mostrar el estereotipo. Puedes cambiar este comportamiento
usando skinparam guillemet:
@startuml
@enduml
@startuml
@enduml
@enduml
@enduml
Además puedes definir un título en varias líneas usando las palabras reservadas title y end title .
@startuml
title
<u>Simple</u> communication example
on <i>several</i> lines and using <font color=red>html</font>
This is hosted by <img:sourceforge.jpg>
end title
@enduml
@enduml
hide footbox
title Footer removed
@enduml
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
@enduml
@startuml
skinparam backgroundColor #EEEBDC
skinparam handwritten true
skinparam sequence {
ArrowColor DeepSkyBlue
ActorBorderColor DeepSkyBlue
LifeLineBorderColor blue
LifeLineBackgroundColor #A9DCDF
ParticipantBorderColor DeepSkyBlue
ParticipantBackgroundColor DodgerBlue
ParticipantFontName Impact
ParticipantFontSize 17
ParticipantFontColor #A9DCDF
ActorBackgroundColor aqua
ActorFontColor DeepSkyBlue
ActorFontSize 17
ActorFontName Aapex
}
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
@enduml
box "Foo1"
participant Alice1
participant Alice2
end box
box "Foo2"
participant Bob1
participant Bob2
end box
Alice1 -> Bob1 : hello
Alice1 -> Out : out
@enduml
(First usecase)
(Another usecase) as (UC2)
usecase UC3
usecase (Last\nusecase) as UC4
@enduml
2.2 Actores
Los actores se encierran entre dos puntos.
También puedes usar la palabra reservada actor para definir un actor. Además puedes definir un alias, usando la
palabra reservada as. Este alias será usado más adelante, cuando definamos relaciones.
Veremos más adelante que las declaraciones de los actores son opcionales.
@startuml
:First Actor:
:Another\nactor: as Men2
actor Men3
actor :Last actor: as Men4
@enduml
@enduml
@enduml
2.5 Extensión
Si un actor/caso de uso extiende a otro, puedes usar el símbolo <|--.
@startuml
:Main Admin: as Admin
(Use the application) as (Use)
@enduml
2.7 Estereotipos
Puedes añadir estereotipos mientras defines actores y casos de uso, usando << y >>.
@startuml
User << Human >>
:Main Database: as MySql << Application >>
(Start) << One Shot >>
(Use the application) as (Use) << Main >>
@enduml
También es posible cambiar la dirección de una flecha añadiendo las palabras clave left, right, up or down,
dentro de la misma:
@startuml
:user: -left-> (dummyLeft)
:user: -right-> (dummyRight)
:user: -up-> (dummyUp)
:user: -down-> (dummyDown)
@enduml
Puedes acortar la flecha usando sólo el primer carácter de la dirección (por ejemplo, -d- en lugar de -down-) o los
primeros dos caracteres (-do-).
Por favor tenga en cuenta que no debería abusar de esta funcionalidad : Graphviz usualmente devuelve buenos
resultados sin realizar muchos ajustes.
@enduml
Puede cambiar a left to right usando el comando left to right direction. En ocaciones, el resultado es
mejor con esta dirección.
@startuml
@enduml
skinparam usecase {
BackgroundColor DarkSeaGreen
BorderColor DarkSlateGray
ArrowColor Olive
ActorBorderColor black
ActorFontName Courier
@enduml
3 Diagrama de Clases
@startuml
Class11 <|.. Class12
Class13 --> Class14
Class15 ..> Class16
Class17 ..|> Class18
Class19 <--* Class20
@enduml
@startuml
Class21 #-- Class22
Class23 x-- Class24
Class25 }-- Class26
Class27 +-- Class28
Class29 ^-- Class30
@enduml
@enduml
Se puede añadir una flecha extra apuntando a un objeto, mostrando que objeto actúa sobre el otro objeto, usando <
o > al inicio o al final de la etiqueta.
@startuml
class Car
@enduml
Object : equals()
ArrayList : Object[] elementData
ArrayList : size()
@enduml
class Flight {
flightNumber : Integer
departureTime : Date
}
@enduml
Puede usar los modificadores {field} y {method} para modificar el comportamiento por defecto del parse sobre
los campos y métodos.
@startuml
class Dummy {
{field} A field (despite parentheses)
{method} Some method
}
@enduml
class Dummy {
-field1
#field2
~method1()
+method2()
}
@enduml
@enduml
@startuml
class Dummy {
{static} String id
{abstract} void methods()
}
@enduml
class User {
.. Simple Getter ..
+ getName()
+ getAddress()
.. Some setter ..
+ setName()
__ private data __
int age
-- encrypted --
String password
}
@enduml
class Foo
note left: On last defined class
@enduml
class Foo
note left: On last defined class
note as N1
This note is <u>also</u>
<b><color:royalBlue>on several</color>
<s>words</s> lines
And this is hosted by <img:sourceforge.jpg>
end note
@enduml
class Dummy
@enduml
class ArrayList {
Object[] elementData
size()
}
enum TimeUnit {
DAYS
HOURS
MINUTES
}
annotation SuppressWarnings
@enduml
class Dummy1 {
+myMethods()
}
class Dummy2 {
+hiddenMethod()
}
hide members
hide <<Serializable>> circle
show Dummy1 methods
show <<Serializable>> fields
@enduml
class Foo1
class Foo2
hide Foo2
@enduml
@enduml
3.16 Paquetes
Puedes definir un paquete usando la palabra reservada package, y opcionalmente declarar un color de fondo para
tu paquete (Usando el nombre o el código HTML del color).
Tenga en cuenta que las definiciones de paquetes pueden ser anidadas.
@startuml
package net.sourceforge.plantuml {
Object <|-- Demo1
Demo1 *- Demo2
}
@enduml
@enduml
package foo1.foo2 {
}
package foo1.foo2.foo3 {
class Object
}
@enduml
class BaseClass
namespace net.foo {
@enduml
set namespaceSeparator ::
class X1::X2::foo {
some info
}
@enduml
Puedes deshabilitar la creación automática de paquetes usando el comando set namespaceSeparator none.
@startuml
@enduml
También es posible cambiar la dirección de la flecha añadiendo las palabras claves left, right, up or down dentro
de la flecha:
@startuml
foo -left-> dummyLeft
foo -right-> dummyRight
foo -up-> dummyUp
foo -down-> dummyDown
@enduml
Puedes acortar la flecha usando el primer carácter de la dirección (por ejemplo, -d- en lugar de -down-) o los
primeros dos caracteres.
Por favor tenga en cuenta que no debería abusar de esta funcionalidad : Graphviz usualmente otorga buenos resul-
tados sin necesidad de ajustar.
class Enrollment {
drop()
cancel()
}
@enduml
class Enrollment {
drop()
cancel()
}
@enduml
skinparam class {
BackgroundColor PaleGreen
ArrowColor SeaGreen
BorderColor SpringGreen
}
skinparam stereotypeCBackgroundColor YellowGreen
@enduml
skinparam class {
BackgroundColor PaleGreen
ArrowColor SeaGreen
BorderColor SpringGreen
BackgroundColor<<Foo>> Wheat
BorderColor<<Foo>> Tomato
}
skinparam stereotypeCBackgroundColor YellowGreen
skinparam stereotypeCBackgroundColor<< Foo >> DimGray
Class01 <<Foo>>
Class03 <<Foo>>
Class01 "1" *-- "many" Class02 : contains
@enduml
@enduml
class Bar1
class Bar2
together {
class Together1
class Together2
class Together3
}
Together1 - Together2
Together2 - Together3
Together2 -[hidden]--> Bar1
Bar1 -[hidden]> Bar2
@enduml
class BaseClass
namespace net.foo {
net.dummy.Person <|- Person
.BaseClass <|-- Person
4 Diagrama de Actividades
@enduml
@enduml
• -right-> or ->
• -left->
• -up->
@startuml
@enduml
@enduml
Desafortunadamente, a veces tendrás que repetir la misma actividad en el texto del diagrama:
@startuml
(*) --> "check input"
If "input is verbose" then
--> [Yes] "turn on verbosity"
--> "run command"
else
--> "run command"
Endif
-->(*)
@enduml
if "" then
-> "activity 3" as a3
else
if "Other test" then
-left-> "activity 5"
else
--> "activity 6"
endif
endif
else
endif
@enduml
4.6 Sincronización
Puedes usar === code === para mostrar barras de sincronización.
@startuml
--> (*)
@enduml
4.8 Notas
Puedes añadir notas sobre la actividad usando los comandos note left, note right, note top or note bottom,
justo después de la descripción de la actividad a la quieres añadirle la nota.
Si quieres colocar una nota sobre el punto de inicio, define la nota al comienzo de la descripción del diagrama.
También puedes tener una nota de varias líneas, usando la palabra reservada endnote .
@startuml
@enduml
4.9 Partición
Puedes definir una partición usando la palabra reservada partition y opcionalmente declarar un color de fondo
para tu partición (Usando el nombre o código HTML del color)
Cuando declaras actividades, éstas son automáticamente colocadas en la última partición usada.
Puedes cerrar la partición usando una llave de cierre }.
@startuml
partition Conductor {
(*) --> "Climbs on Platform"
--> === S1 ===
--> Bows
}
partition Conductor {
Bows --> === S2 ===
--> WavesArmes
Applauds --> === S2 ===
}
@enduml
@enduml
4.11 Octágono
Puedes cambiar la forma de las actividades a un octágono usando el comando skinparam activityShape
octagon .
@startuml
'Default is skinparam activityShape roundBox
skinparam activityShape octagon
@enduml
if "Page.onSecurityCheck" then
->[true] "Page.onInit()"
if "isForward?" then
->[no] "Process controls"
else
-->[yes] ===RENDERING===
endif
else
-->[false] ===REDIRECT_CHECK===
endif
--> "Page.onDestroy()"
-->(*)
@enduml
5.2 Start/Stop
Puedes usar las palabras reservadas start y stop para denotar el comienzo y el final del diagrama.
@startuml
start
:Hello world;
:This is on defined on
several **lines**;
stop
@enduml
@startuml
start
:Hello world;
:This is on defined on
several **lines**;
end
@enduml
5.3 Condicionales
Puedes usar las palabras reservadas if, then y else para colocar condiciones en tus diagramas. Las etiquetas
pueden ser proporcionadas usando paréntesis.
@startuml
start
stop
@enduml
start
repeat
:read data;
:generate diagrams;
repeat while (more data?)
stop
@enduml
start
stop
@enduml
Es posible proporcionar una etiqueta después de la palabra reservada endwhile, o usar la palabra reservada is .
@startuml
while (check filesize ?) is (not empty)
:read file;
endwhile (empty)
:close file;
@enduml
start
:Treatment 2;
end fork
else (monoproc)
:Treatment 1;
:Treatment 2;
endif
@enduml
5.7 Notas
Se puede aplicar formato a un texto usando sintaxis de WikiCreole.
Una nota puede ser flotante, usando la palabra clave floating.
@startuml
start
:foo1;
floating note left: This is a note
:foo2;
note right
This note is on several
//lines// and can
contain <b>HTML</b>
====
* Calling the method ""foo()"" is prohibited
end note
stop
@enduml
5.8 Colores
Puedes especificar colores en algunas actividades.
@startuml
start
:starting progress;
#HotPink:reading configuration files
These files should edited at this point!;
#AAAAAA:ending of the process;
@enduml
5.9 Flechas
Usando la notación ->, puedes añadir texto a una flecha y cambiar su color.
También es posible tener flechas punteadas, en linea discontinua, en negrita u ocultas.
@startuml
:foo1;
-> You can put text on arrows;
if (test) then
-[#blue]->
:foo2;
-[#green,dashed]-> The text can
also be on several lines
and **very** long...;
:foo3;
else
-[#black,dotted]->
:foo4;
endif
-[#gray,bold]->
:foo5;
@enduml
5.10 Connector
You can use parentheses to denote connector.
@startuml
start
:Some activity;
(A)
detach
(A)
:Other activity;
@enduml
5.11 Agrupación
Puedes agrupar actividades definiendo particiones:
@startuml
start
partition Initialization {
:read config file;
:init internal variable;
}
partition Running {
:wait for user interaction;
:print information;
}
stop
@enduml
5.12 Carriles
Usando la tecla pipe |, puedes definir carriles.
También es posible cambiar el color de los carriles.
@startuml
|Swimlane1|
start
:foo1;
|#AntiqueWhite|Swimlane2|
:foo2;
:foo3;
|Swimlane1|
:foo4;
|Swimlane2|
:foo5;
stop
@enduml
stop
end split
:finish;
@enduml
start
:ClickServlet.handleRequest();
:new page;
if (Page.onSecurityCheck) then (true)
:Page.onInit();
if (isForward?) then (no)
:Process controls;
if (continue processing?) then (no)
stop
endif
:redirect process;
else
if (do forward?) then (yes)
:Forward request;
else (no)
:Render page template;
endif
endif
stop
@enduml
6 Diagrama de Componentes
Veamos algunos ejemplos :
6.1 Componentes
Los componentes deberían ser encerrados entre corchetes [].
También puedes usar la palabra reservada component para definir un componente. Y puedes definir un alias,
usando la palabra reservada as. Este alias será usado más adelante, cuando definamos relaciones.
@startuml
[First component]
[Another component] as Comp2
component Comp3
component [Last\ncomponent] as Comp4
@enduml
6.2 Interfaces
Puedes definir una interfaz usando el símbolo () (porque esto luce como un circulo).
Puedes usar también la palabra reservada interface para definir una interfaz. Y puedes definir un alias, usando
la palabra reservada as. Este alias sera usado luego, definiendo las relaciones.
Nosotros veremos mas adelante que la definición de interfaz es opcional.
@startuml
() "First Interface"
() "Another interface" as Interf2
interface Interf3
interface "Last\ninterface" as Interf4
@enduml
@enduml
DA - [First Component]
[First Component] ..> HTTP : use
@enduml
• package
• node
• folder
• frame
• cloud
• database
@startuml
cloud {
[Example 1]
}
database "MySql" {
folder "This is my folder" {
[Folder 3]
}
frame "Foo" {
[Frame 4]
}
}
@enduml
También es posible cambiar la dirección de las flechas agregando la palabra reservada left, right, up o down
dentro de la flecha:
@startuml
[Component] -left-> left
[Component] -right-> right
[Component] -up-> up
[Component] -down-> down
@enduml
Puedes acortar la flecha usando el primer caracter (por ejemplo, -d- en lugar de -down-) o los dos primeros
caracteres (-do-).
Por favor nota que no puedes abuzar de esta funcionalidad Graphviz que usualmente otorga buenos resultados sin
ajustes.
DA - [First Component]
[First Component] ..> HTTP : use
@enduml
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
}
skinparam interface {
backgroundColor RosyBrown
borderColor orange
}
skinparam component {
FontSize 13
BackgroundColor<<Apache>> Red
BorderColor<<Apache>> #FF6655
FontName Courier
BorderColor black
BackgroundColor gold
ArrowFontName Impact
ArrowColor #FF6655
ArrowFontColor #777777
}
() "Data Access" as DA
DA - [First Component]
[First Component] ..> () HTTP : use
@enduml
@startuml
[AA] <<static lib>>
[BB] <<shared lib>>
[CC] <<static lib>>
node node1
node node2 <<shared node>>
database Production
skinparam component {
backgroundColor<<static lib>> DarkKhaki
backgroundColor<<shared lib>> Green
}
skinparam node {
borderColor Green
backgroundColor Yellow
backgroundColor<<shared node>> Magenta
}
skinparam databaseBackgroundColor Aqua
@enduml
7 Diagrama de Estados
@enduml
state NotShooting {
[*] --> Idle
Idle --> Configuring : EvConfig
Configuring --> Idle : EvConfig
}
state Configuring {
[*] --> NewValueSelection
NewValueSelection --> NewValuePreview : EvNewValue
NewValuePreview --> NewValueSelection : EvNewValueRejected
NewValuePreview --> NewValueSelection : EvNewValueSaved
state NewValuePreview {
State1 -> State2
}
}
@enduml
@enduml
state Active {
[*] -> NumLockOff
NumLockOff --> NumLockOn : EvNumLockPressed
NumLockOn --> NumLockOff : EvNumLockPressed
--
[*] -> CapsLockOff
CapsLockOff --> CapsLockOn : EvCapsLockPressed
CapsLockOn --> CapsLockOff : EvCapsLockPressed
--
[*] -> ScrollLockOff
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
@enduml
@enduml
Puedes acortar un flecha usando sólamente el primer carácter del nombre de la dirección (por ejemplo, -d- en lugar
de -down-) o los dos primeros caracteres (-do-).
Por favor tenga en cuenta que no debería de esta funcionalidad : Graphviz usualmente devuelve buenos resultados
sin necesidad de configuración.
7.7 Notas
También puedes definir notas usando las palabras reservadas note left of, note right of, note top of,
note bottom of .
También puedes definir notas de varias líneas.
@startuml
@enduml
state foo
note "This is a floating note" as N1
@enduml
@enduml
EndColor Red
BackgroundColor Peru
BackgroundColor<<Warning>> Olive
BorderColor Gray
FontName Impact
}
8 Diagrama de Objetos
@startuml
object user
@enduml
object user {
name = "Dummy"
id = 123
}
@enduml
9 Timing Diagram
This is only a proposal and subject to change.
You are very welcome to create a new discussion on this future syntax. Your feedbacks, ideas and suggestions help
us to find the right solution.
@0
WU is Idle
WB is Idle
@100
WU is Waiting
WB is Processing
@300
WB is Waiting
@enduml
@0
WU is Idle
WB is Idle
@100
WU -> WB : URL
WU is Waiting
WB is Processing
@300
WB is Waiting
@enduml
@0
WU is Idle
WB is Idle
DNS is Idle
@+100
WU -> WB : URL
WU is Waiting
WB is Processing
@+200
WB is Waiting
WB -> DNS@+50 : Resolve URL
@+100
DNS is Processing
@+300
DNS is Idle
@enduml
@WB
0 is idle
+200 is Proc.
+100 is Waiting
@WU
0 is Waiting
+500 is ok
@enduml
@WU
0 is Waiting
+500 is ok
@enduml
WB is Initializing
WU is Absent
@WB
0 is idle
+200 is Processing
+100 is Waiting
@WU
0 is Waiting
+500 is ok
@enduml
@0
WU is {-}
@100
WU is A1
@200
WU is {-}
@300
WU is {hidden}
@400
WU is A3
@500
WU is {-}
@enduml
WB is Initializing
WU is Absent
@WB
0 is idle
+200 is Processing
+100 is Waiting
WB@0 <-> @50 : {50 ms lag}
@WU
0 is Waiting
+500 is ok
@200 <-> @+150 : {150 ms}
@enduml
@0
WU is Idle
WB is Idle
@100
WU is Waiting
WB is Processing
@300
WB is Waiting
@enduml
10 Gantt Diagram
This is only a proposal and subject to change.
You are very welcome to create a new discussion on this future syntax. Your feedbacks, ideas and suggestions help
us to find the right solution.
The Gantt is described in natural language, using very simple sentences (subject-verb-complement).
@startgantt
[Prototype design] lasts 10 days
[Code prototype] lasts 10 days
[Write tests] lasts 5 days
[Code prototype] starts at [Prototype design]'s end
[Write tests] starts at [Code prototype]'s start
@endgantt
10.5 Milestone
You can define Milestones using the happens verb.
@startgantt
[Test prototype] lasts 10 days
[Prototype completed] happens at [Test prototype]'s end
[Setup assembly line] lasts 12 days
[Setup assembly line] starts at [Test prototype]'s end
@endgantt
10.6 Calendar
You can specify a starting date for the whole project. By default, the first task starts at this date.
@startgantt
Project starts the 20th of september 2017
[Prototype design] as [TASK1] lasts 13 days
[TASK1] is colored in Lavender/LightBlue
@endgantt
@endgantt
10.9 Separator
You can use -- to separate sets of tasks.
@startgantt
[Task1] lasts 10 days
then [Task2] lasts 4 days
-- Phase Two --
then [Task3] lasts 5 days
then [Task4] lasts 6 days
@endgantt
11 MindMap
MindMap diagram are still in beta: the syntax may change without notice.
left side
** A
*** AA
*** AB
** B
@endmindmap
* <&flag>Debian
** <&globe>Ubuntu
*** Linux Mint
*** Kubuntu
*** Lubuntu
*** KDE Neon
** <&graph>LMDE
** <&pulse>SolydXK
** <&people>SteamOS
** <&star>Raspbian with a very long name
*** <s>Raspmbc</s> => OSMC
*** <s>Raspyfi</s> => Volumio
header
My super header
endheader
legend right
Short
legend
endlegend
@endmindmap
@endwbs
+ Part One
+ Task 1.1
- LeftTask 1.2
+ Task 1.3
+ Part Two
+ Task 2.1
+ Task 2.2
-_ Task 2.2.1 To the left boxless
-_ Task 2.2.2 To the Left boxless
+_ Task 2.2.3 To the right boxless
@endwbs
13 Maths
You can use AsciiMath or JLaTeXMath notation within PlantUML:
@startuml
:<math>int_0^1f(x)dx</math>;
:<math>x^2+y_1+z_12^34</math>;
note right
Try also
<math>d/dxf(x)=lim_(h->0)(f(x+h)-f(x))/h</math>
<latex>P(y|\mathbf{x}) \mbox{ or } f(\mathbf{x})+\epsilon</latex>
end note
@enduml
or:
@startuml
Bob -> Alice : Can you solve: <math>ax^2+bx+c=0</math>
Alice --> Bob: <math>x = (-b+-sqrt(b^2-4ac))/(2a)</math>
@enduml
14 Common commands
14.1 Comments
Everything that starts with simple quote ' is a comment.
You can also put comments on several lines using /' to start and '/ to end.
header
<font color=red>Warning:</font>
Do not use in production.
endheader
@enduml
14.3 Zoom
You can use the scale command to zoom the generated image.
You can use either a number or a fraction to define the scale factor. You can also specify either width or height (in
pixel). And you can also give both width and height : the image is scaled to fit inside the specified dimension.
• scale 1.5
• scale 2/3
• scale 200 width
• scale 200 height
• scale 200*100
• scale max 300*200
• scale max 1024 width
• scale max 800 height
@startuml
scale 180*90
Bob->Alice : hello
@enduml
14.4 Title
The title keywords is used to put a title. You can add newline using \n in the title description.
Some skinparam settings are available to put borders on the title.
@startuml
skinparam titleBorderRoundCorner 15
skinparam titleBorderThickness 2
skinparam titleBorderColor red
skinparam titleBackgroundColor Aqua-CadetBlue
@enduml
title
<u>Simple</u> communication example
on <i>several</i> lines and using <back:cadetblue>creole tags</back>
end title
@enduml
14.5 Caption
There is also a caption keyword to put a caption under the diagram.
@startuml
caption figure 1
Alice -> Bob: Hello
@enduml
@startuml
Alice -> Bob : Hello
legend top left
Short
legend
endlegend
@enduml
15 Salt (wireframe)
Salt is a subproject included in PlantUML that may help you to design graphical interface.
You can use either @startsalt keyword, or @startuml followed by a line with salt keyword.
The goal of this tool is to discuss about simple and sample windows.
Just after the opening bracket, you can use a character to define if you want to draw lines or columns of the grid :
Symbol Result
# To display all vertical and horizontal lines
! To display all vertical lines
- To display all horizontal lines
+ To display external lines
@startsalt
{+
Login | "MyName "
Password | "**** "
[Cancel] | [ OK ]
}
@endsalt
15.10 OpenIconic
OpenIconic is an very nice open source icon set. Those icons have been integrated into the creole parser, so you
can use them out-of-the-box. You can use the following syntax: <&ICON_NAME>.
@startsalt
{
Login<&person> | "MyName "
Password<&key> | "**** "
[Cancel <&circle-x>] | [OK <&account-login>]
}
@endsalt
The complete list is available on OpenIconic Website, or you can use the following special diagram:
@startuml
listopeniconic
@enduml
()two
[ok]
}
}}
" as choose
@startuml
!unquoted function SALT($x)
"{{
salt
%invoke_void_func("_"+$x)
}}" as $x
!endfunction
!function _choose()
{+
<b>an example
choose one option
()one
()two
[ok]
}
!endfunction
!function _wait()
{+
<b>please wait
operation in progress
<&clock>
[cancel]
}
!endfunction
!function _success()
{+
<b>success
congratulations!
[ok]
}
!endfunction
!function _error()
{+
<b>error
failed, sorry
[ok]
}
!endfunction
@startsalt
{SI
Message
.
.
.
.
}
@endsalt
@startsalt
{S-
Message
.
.
.
.
}
@endsalt
16 Creole
A light Creole engine has been integrated into PlantUML to have a standardized way of defining text style.
All diagrams are now supporting this syntax.
Note that ascending compatibility with HTML syntax is preserved.
16.2 List
@startuml
object demo {
* Bullet list
* Second item
}
note left
* Bullet list
* Second item
** Sub item
end note
legend
# Numbered list
# Second item
## Sub item
## Another sub item
# Third item
end legend
@enduml
@enduml
16.5 Headings
@startuml
usecase UC1 as "
= Extra-large heading
Some text
== Large heading
Other text
=== Medium heading
Information
....
==== Small heading"
@enduml
16.7 Table
It is possible to build table.
@startuml
skinparam titleFontSize 14
title
Example of simple table
|= |= table |= header |
| a | table | row |
| b | table | row |
end title
[*] --> State1
@enduml
16.8 Tree
You can use |_ characters to build a tree.
@startuml
skinparam titleFontSize 14
title
Example of Tree
|_ First line
|_ **Bom(Model)**
|_ prop1
|_ prop2
|_ prop3
|_ Last line
end title
[*] --> State1
@enduml
16.10 OpenIconic
OpenIconic is an very nice open source icon set. Those icons have been integrated into the creole parser, so you
can use them out-of-the-box.
The complete list is available on OpenIconic Website, or you can use the following special diagram:
@startuml
listopeniconic
@enduml
17.3 Examples
@startuml
sprite $printer [15x15/8z] NOtH3W0W208HxFz_kMAhj7lHWpa1XC716sz0Pq4MVPEWfBHIuxP3L6kbTcizR8tAhzaqFvXwvFf
start
:click on <$printer> to print the page;
@enduml
@startuml
sprite $bug [15x15/16z] PKzR2i0m2BFMi15p__FEjQEqB1z27aeqCqixa8S4OT7C53cKpsHpaYPDJY_12MHM-BLRyywPhrrlw
sprite $printer [15x15/8z] NOtH3W0W208HxFz_kMAhj7lHWpa1XC716sz0Pq4MVPEWfBHIuxP3L6kbTcizR8tAhzaqFvXwvF
sprite $disk {
444445566677881
436000000009991
43600000000ACA1
53700000001A7A1
53700000012B8A1
53800000123B8A1
63800001233C9A1
634999AABBC99B1
744566778899AB1
7456AAAAA99AAB1
8566AFC228AABB1
8567AC8118BBBB1
867BD4433BBBBB1
39AAAAABBBBBBC1
}
class Example {
Can have some bug : <$bug>
Click on <$disk> to save
}
@enduml
18 Skinparam command
You can change colors and font of the drawing using the skinparam command.
Example:
skinparam backgroundColor transparent
18.1 Usage
You can use this command :
• In the diagram definition, like any other commands,
• In an included file,
• In a configuration file, provided in the command line or the ANT task.
18.2 Nested
To avoid repetition, it is possible to nest definition. So the following definition :
skinparam xxxxParam1 value1
skinparam xxxxParam2 value2
skinparam xxxxParam3 value3
skinparam xxxxParam4 value4
is strictly equivalent to:
skinparam xxxx {
Param1 value1
Param2 value2
Param3 value3
Param4 value4
}
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
deactivate B
@enduml
18.4 Shadowing
You can disable the shadowing using the skinparam shadowing false command.
@startuml
actor User
(Glowing use case) <<with_shadow>> as guc
(Flat use case) <<no_shadow>> as fuc
User -- guc
User -- fuc
@enduml
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
@enduml
18.6 Colors
You can use either standard color name or RGB code.
18.9 Examples
@startuml
skinparam backgroundColor #EEEBDC
skinparam handwritten true
skinparam sequence {
ArrowColor DeepSkyBlue
ActorBorderColor DeepSkyBlue
LifeLineBorderColor blue
LifeLineBackgroundColor #A9DCDF
ParticipantBorderColor DeepSkyBlue
ParticipantBackgroundColor DodgerBlue
ParticipantFontName Impact
ParticipantFontSize 17
ParticipantFontColor #A9DCDF
ActorBackgroundColor aqua
ActorFontColor DeepSkyBlue
ActorFontSize 17
ActorFontName Aapex
}
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
@enduml
@startuml
skinparam handwritten true
skinparam actor {
BorderColor black
FontName Courier
BackgroundColor<< Human >> Gold
}
skinparam usecase {
BackgroundColor DarkSeaGreen
BorderColor DarkSlateGray
ArrowColor Olive
}
@startuml
skinparam roundcorner 20
skinparam class {
BackgroundColor PaleGreen
ArrowColor SeaGreen
BorderColor SpringGreen
}
skinparam stereotypeCBackgroundColor YellowGreen
@startuml
skinparam interface {
backgroundColor RosyBrown
borderColor orange
}
skinparam component {
FontSize 13
BackgroundColor<<Apache>> Red
BorderColor<<Apache>> #FF6655
FontName Courier
BorderColor black
BackgroundColor gold
ArrowFontName Impact
ArrowColor #FF6655
ArrowFontColor #777777
}
() "Data Access" as DA
DA - [First Component]
[First Component] ..> () HTTP : use
@startuml
[AA] <<static lib>>
[BB] <<shared lib>>
[CC] <<static lib>>
node node1
node node2 <<shared node>>
database Production
skinparam component {
backgroundColor<<static lib>> DarkKhaki
backgroundColor<<shared lib>> Green
}
skinparam node {
borderColor Green
backgroundColor Yellow
backgroundColor<<shared node>> Magenta
}
skinparam databaseBackgroundColor Aqua
@enduml
Or you can generate a "diagram" with a list of all the skinparam parameters using:
@startuml
help skinparams
@enduml
That will give you the following result:
You can also view each skinparam parameters with its results displayed at https://plantuml-documentation.readthedocs.
io/en/latest/formatting/all-skin-params.html.
19 Preprocessing
Some minor preprocessing capabilities are included in PlantUML, and available for all diagrams.
Those functionalities are very similar to the C language preprocessor, except that the special character # has been
changed to the exclamation mark !.
19.3 Conditions
• You can use expression in condition.
!function init_class($name)
class $name {
$addCommonMethod()
}
!endfunction
!function $addCommonMethod()
toString()
hashCode()
!endfunction
init_class("foo1")
init_class("foo2")
msg("foo1", "foo2")
@enduml
Variables defined in functions are local. It means that the variable is destroyed when the function is exited.
As in void function, variable are local by default (they are destroyed when the function is exited). However, you
can access to global variables from function. However, you can use the local keyword to create a local variable
if ever a global variable exists with the same name.
@startuml
!function $dummy()
!local $ijk = "local"
Alice -> Bob : $ijk
!endfunction
!include List.iuml
List <|.. ArrayList
@enduml
File List.iuml
interface List
List : int size()
List : void clear()
The file List.iuml can be included in many diagrams, and any modification in this file will change all diagrams
that include it.
You can also put several @startuml/@enduml text block in an included file and then specify which block you
want to include adding !0 where 0 is the block number. The !0 notation denotes the first diagram.
For example, if you use !include foo.txt!1, the second @startuml/@enduml block within foo.txt will be
included.
You can also put an id to some @startuml/@enduml text block in an included file using @startuml(id=MY_OWN_ID)
syntax and then include the block adding !MY_OWN_ID when including the file, so using something like !include
foo.txt!MY_OWN_ID.
By default, a file can only be included once. You can use !include_many instead of !include if you want to
include some file several times. Note that there is also a !include_once directive that raises an error if a file is
included several times.
A -> A : stuff1
!startsub BASIC
B -> B : stuff2
!endsub
C -> C : stuff3
!startsub BASIC
D -> D : stuff4
!endsub
@enduml
file1.puml would be rendered exactly as if it were:
@startuml
A -> A : stuff1
B -> B : stuff2
C -> C : stuff3
D -> D : stuff4
@enduml
However, this would also allow you to have another file2.puml like this:
file2.puml
@startuml
Name Description
%strlen Calculate the length of a String %
%substr Extract a substring. Takes 2 or 3 arguments| %substr("abcdef", 3, 2) "d
%strpos Search a substring in a string %strpo
%inval Convert a String to Int %
%file_exists Check if a file exists on the local filesystem %file_exis
%function_exists Check if a function exists %function_e
%variable_exists Check if a variable exists %variable_
%set_variable_value Set a global variable %set_variable_value
%get_variable_value Retrieve some variable value %get_variabl
%getenv Retrieve environment variable value %
%dirpath Retrieve current dirpath
%filename Retrieve current filename
%date Retrieve current date. You can provide an optional format for the date %date("y
%true Return always true
%false Return always false
%not Return the logical negation of an expression
19.11 Logging
You can use !log to add some log output when generating the diagram. This has no impact at all on the diagram
itself. However, those logs are printed in the command line's output stream. This could be useful for debug purpose.
@startuml
!function bold($text)
!$result = "<b>"+ $text +"</b>"
!log Calling bold function with $text. The result is $result
!return $result
!endfunction
!unused = "foo"
!dump_memory EOF
@enduml
19.13 Assertion
You can put assertion in your diagram.
@startuml
Alice -> Bob : Hello
!assert %strpos("abcdef", "cd")==3 : "This always fail"
@enduml
!import /path/to/customLibrary.zip
' This just adds "customLibrary.zip" in the search path
!include myFolder/myFile.iuml
' Assuming that myFolder/myFile.iuml is located somewhere
' either inside "customLibrary.zip" or on the local filesystem
...
COMP_TEXTGENCOMP(dummy)
@enduml
!$wrapper = "$go"
%invoke_void_func($wrapper)
@enduml
For return functions, you can use the corresponding special function %call_user_func() :
@startuml
!function bold($text)
!return "<b>"+ $text +"</b>"
!endfunction
20 Unicode
The PlantUML language use letters to define actor, usecase and soon.
But letters are not only A-Z latin characters, it could be any kind of letter from any language.
20.1 Examples
@startuml
skinparam handwritten true
skinparam backgroundColor #EEEBDC
actor 使用者
participant "頭等艙" as A
participant "第二類" as B
participant "最後一堂課" as 別的東西
A -> B: 創建請求
activate B
B --> A: 請求創建
deactivate B
A --> 使用者: 做完
deactivate A
@enduml
@startuml
--> 鞠躬向公眾
--> === S2 ===
--> 這傢伙波武器
--> (*)
@startuml
@startuml
() "Σωκράτηςψεύτης" as Σωκράτης
Σωκράτης - [Πτηνά πολεμοχαρής]
[Πτηνά πολεμοχαρής] ..> () Αθήνα : Αυτές οι φράσειςσημαίνουν τίποτα
@enduml
20.2 Charset
The default charset used when reading the text files containing the UML text description is system dependent.
Normally, it should just be fine, but in some case, you may want to the use another charset. For example, with the
command line:
java -jar plantuml.jar -charset UTF-8 files.txt
Or, with the ant task:
<!-- Put images in c:/images directory -->
<target name="main">
<plantuml dir="./src" charset="UTF-8" />
Depending of your Java installation, the following charset should be available: ISO-8859-1, UTF-8, UTF-16BE,
UTF-16LE, UTF-16.
21 Standard Library
This page explains the official Standard Library for PlantUML This Standard Library is now included in official
releases of PlantUML. Including files follows the C convention for "C standard library" (see https://en.wikipedia.
org/wiki/C_standard_library )
Contents of the library come from third party contributors. We thank them for their usefull contribution!
AMAZONS3(s3_internal)
AMAZONS3(s3_partner,"Vendor's S3")
s3_internal <- s3_partner
@enduml
@enduml
FA_SERVER(web1,web1) #Green
FA_SERVER(web2,web2) #Yellow
FA_SERVER(web3,web3) #Blue
FA_SERVER(web4,web4) #YellowGreen
FA_DATABASE(db1,LIVE,database,white) #RoyalBlue
FA_DATABASE(db2,SPARE,database) #Red
@startuml
!include <tupadr3/common>
!include <tupadr3/devicons/mysql>
DEV_MYSQL(db1)
DEV_MYSQL(db2,label of db2)
DEV_MYSQL(db3,label of db3,database)
DEV_MYSQL(db4,label of db4,database,red) #DeepSkyBlue
@enduml
Notes
When mixing sprites macros with other elements you may get a syntax error if, for example, trying to add a rectangle
along with classes. In those cases, add { and } after the macro to create the empty rectangle.
Example of usage:
@startuml
!include <material/common>
' To import the sprite file you DON'T need to place a prefix!
!include <material/folder_move>
class foo {
bar
}
@enduml
21.6 Office
https://github.com/Roemer/plantuml-office
There are sprites (*.puml) and colored png icons available. Be aware that the sprites are all only monchrome even
if they have a color in their name (due to automatically generating the files). You can either color the sprites with
the macro (see examples below) or directly use the fully colored pngs. See the following examples on how to use
the sprites, the pngs and the macros.
Example of usage:
@startuml
!include <tupadr3/common>
!include <office/Servers/database_server>
!include <office/Servers/application_server>
!include <office/Concepts/firewall_orange>
!include <office/Clouds/cloud_disaster_red>
package "Sprites" {
OFF_DATABASE_SERVER(db,DB)
OFF_APPLICATION_SERVER(app,App-Server)
OFF_FIREWALL_ORANGE(fw,Firewall)
OFF_CLOUD_DISASTER_RED(cloud,Cloud)
db <-> app
app <--> fw
fw <.left.> cloud
}
@enduml
@startuml
!include <tupadr3/common>
!include <office/servers/database_server>
!include <office/servers/application_server>
!include <office/Concepts/firewall_orange>
!include <office/Clouds/cloud_disaster_red>
21.7 ArchiMate
https://github.com/ebbypeter/Archimate-PlantUML
This repository contains ArchiMate PlantUML macros and other includes for creating Archimate Diagrams easily
and consistanly.
@startuml Internet Browser Example
!includeurl https://raw.githubusercontent.com/ebbypeter/Archimate-PlantUML/master/Archimate.puml
' Elements
Business_Object(businessObject, "A Business Object")
Business_Process(someBusinessProcess,"Some Business Process")
Business_Service(itSupportService, "IT Support for Business (Application Service)")
'Relationships
Rel_Flow_Left(someBusinessProcess, businessObject, "")
Rel_Serving_Up(itSupportService, someBusinessProcess, "")
Rel_Specilization_Up(webpageBehaviour, itSupportService, "")
Rel_Flow_Right(dataObject, webpageBehaviour, "")
Rel_Specilization_Up(dataObject, businessObject, "")
Rel_Assignment_Left(ActivePartWebPage, webpageBehaviour, "")
Rel_Specilization_Up(inMemoryItem, dataObject, "")
Rel_Realization_Up(inMemoryItem, ActivePartWebPage, "")
Rel_Specilization_Right(inMemoryItem,internetBrowser, "")
Rel_Serving_Up(internetBrowser, webpageBehaviour, "")
Rel_Serving_Up(internetBrowserPlugin, webpageBehaviour, "")
Rel_Aggregation_Right(internetBrowser, internetBrowserPlugin, "")
Rel_Access_Up(webServer, inMemoryItem, "")
@enduml
21.8 Miscellaneous
You can list standard library folders using the special diagram:
@startuml
stdlib
@enduml
It is also possible to use the command line java -jar plantuml.jar -stdlib to display the same list.
Finally, you can extract the full standard library sources using java -jar plantuml.jar -extractstdlib.
All files will be extracted in the folder stdlib.
Sources used to build official PlantUML releases are hosted here https://github.com/plantuml/plantuml-stdlib.You
can create Pull Request to update or add some library if you find it relevant.
Contents
1 Diagrama de Secuencia 1
1.1 Ejemplo básico . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Declarando participantes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Sin usar letras en participantes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Auto-Mensaje . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Cambiar estilo de la flecha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 Cambiar el color de la flecha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.7 Numeración de la secuencia de mensajes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.8 Page Title, Header and Footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.9 Dividiendo diagramas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.10 Agrupando mensajes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.11 Notas en mensajes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.12 Algunas otras notas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.13 Cambiando el aspecto de las notas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.14 Creole y HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.15 Divisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.16 Referencia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.17 Retardo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.18 Espaciado . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.19 Activación y Destrucción de la Línea de vida . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.20 Return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.21 Creación de participante . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.22 Mensajes entrantes y salientes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.23 Estereotipos y marcas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.24 Mayor información en los títulos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.25 Entorno de participante . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.26 Removiendo pie de página . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.27 Personalización (Skinparam) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.28 Cambiando el relleno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3 Diagrama de Clases 33
3.1 Relación entre clases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2 Etiquetas en las relaciones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3 Añadiendo métodos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.4 Definiendo la visibilidad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.5 Abstracto y Estático . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.6 Cuerpo avanzado de las clases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.7 Notas y estereotipos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.8 Más acerca de notas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.9 Notas en enlaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.10 Clases abstractas e interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.11 Sin usar letras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.12 Atributos, métodos... ocultos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4 Diagrama de Actividades 53
4.1 Actividades simples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.2 Etiquetas en las flechas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3 Cambiando la dirección de la flecha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.4 Ramas (bifurcaciones) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.5 Más acerca de las Ramas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.6 Sincronización . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.7 Descripción de actividades de gran contenido . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.8 Notas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.9 Partición . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.10 Personalización (Skinparam) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.11 Octágono . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.12 Un ejemplo completo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6 Diagrama de Componentes 75
6.1 Componentes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.2 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.3 Ejemplos basicos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.4 Usando notas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.5 Agrupando componentes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.6 Cambiando la dirección de las flechas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.7 Utiliza la notación UML2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
6.8 Long description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
6.9 Colores individuales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
6.10 Using Sprite in Stereotype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
6.11 Personalización (Skinparam) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7 Diagrama de Estados 83
7.1 Un Estado Simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.2 Change state rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.3 Estados compuestos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.4 Nombres largos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.5 Estados simultáneos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.6 Dirección de la flecha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.7 Notas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.8 Más sobre notas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.9 Personalización (Skinparam) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8 Diagrama de Objetos 91
8.1 Definición de objetos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.2 Relaciones entre objetos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.3 Agregando campos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.4 Características comunes en diagramas de clases . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
9 Timing Diagram 93
9.1 Declaring participant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
9.2 Adding message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
9.3 Relative time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
9.4 Participant oriented . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.5 Setting scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.6 Initial state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.7 Intricated state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9.8 Hidden state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9.9 Adding constraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9.10 Adding texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
10 Gantt Diagram 99
10.1 Declaring tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.2 Adding constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.3 Short names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.4 Customize colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
10.5 Milestone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
10.6 Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
10.7 Close day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
10.8 Simplified task succession . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
10.9 Separator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
10.10Working with resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
10.11Complex example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
11 MindMap 103
11.1 OrgMode syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
11.2 Removing box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
11.3 Arithmetic notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
11.4 Markdown syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
11.5 Changing diagram direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
11.6 Complete example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
13 Maths 110
13.1 Standalone diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
13.2 How is this working ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
16 Creole 126
16.1 Emphasized text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
16.2 List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
16.3 Escape character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
16.4 Horizontal lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
16.5 Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
16.6 Legacy HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
16.7 Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
16.8 Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
16.9 Special characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
16.10OpenIconic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
19 Preprocessing 145
19.1 Migration notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
19.2 Variable definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
19.3 Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
19.4 Void function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
19.5 Return function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
19.6 Default argument value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
19.7 Unquoted function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
20 Unicode 155
20.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
20.2 Charset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157