🧩
New! Render PlantUML diagrams directly inside GitHub with our official browser extension — No server. No tokens. No tracking. Zero permissions but clipboard. — Try it out and let us know what you think!

Diagrama de actividad

Un diagrama de actividad describe un flujo de trabajo o proceso: los pasos, el orden en que ocurren, así como las decisiones y los caminos paralelos que aparecen en el recorrido. Es adecuado para procesos de negocio, algoritmos y todo lo que fluye de un inicio a un fin.

En PlantUML, usted escribe cada actividad en su propia línea, usando flechas y palabras clave como if, repeat y fork para expresar el flujo de control. El diagrama se genera automáticamente.

Si usted mantiene diagramas antiguos, la sintaxis anterior sigue siendo compatible, pero ya no se recomienda para diagramas nuevos.

Consulte los comandos comunes para conocer las funcionalidades disponibles en todos los tipos de diagramas.

Una Actividad simple

Las etiquetas de las actividades inician con un dos puntos (:) y terminan con un punto y coma (;).

Se puede aplicar formato a un texto usando sintaxis de WikiCreole.

Están implícitamente enlazados en el orden de su definición.

Other simple action (defined as a list)

Simple action list separated by -

Simple action list separated by *

With one level

With several levels

[Ref. GH-2376]

Inicio/Parada/Fin

Puede utilizar las palabras clave start y stop para indicar el inicio y el final de un diagrama.

También puede utilizar la palabra clave end.

Condicional

Puede utilizar las palabras clave if, then, else y endif para colocar pruebas en su diagrama. Las etiquetas pueden proporcionarse utilizando paréntesis.

Las 3 sintaxis son posibles:

[Ref. QA-301]

Condicionales anidadas (modo horizontal)

Puede utilizar la palabra clave elseif para tener varias condicionales anidadas (por defecto, es el modo horizontal):

Condicionales anidadas (modo vertical)

Puede utilizar el comando !pragma useVerticalIf on para tener las condicionales anidadas en modo vertical:

Puede utilizar la opción de línea de comandos -P para especificar el pragma:

java -jar plantuml.jar -PuseVerticalIf=on

[Refs. QA-3931, GH-582]

WARNING
 This translation need to be updated. 
WARNING

Switch case [switch, case, endswitch]

Puedes usar las palabras clave switch, case y endswitch para hacer un switch en tu diagrama.

Puedes colocar etiquetas usando paréntesis.

Conditional with stop on an action [kill, detach]

You can stop action on a if loop.

But if you want to stop at the precise action, you can use the kill or detach keyword:

[Ref. QA-265]

El ciclo Repeat

Puedes usar las palabras reservadas repeat y repeatwhile para colocar bucles.

It is also possible to use a full action as repeat target and insert an action in the return path using the backward keyword.

*[Ref. [QA-5826](https://forum.plantuml.net/5826/please-provide-action-repeat-loop-start-instead-condition?show=5831#a5831)]*

WARNING
 This translation need to be updated. 
WARNING

Break on a repeat loop [break]

You can use the break keyword after an action on a loop.

[Ref. QA-6105]

Goto and Label Processing [label, goto]

⚠ It is currently only experimental 🚧

You can use label and goto keywords to denote goto processing, with:

[Ref. QA-15026, QA-12526 and initially QA-1626]

El ciclo While

Puedes usar las palabras reservadas while y end while para un ciclo repetitivo.

Es posible proporcionar una etiqueta después de la palabra reservada endwhile, o usar la palabra reservada is .

WARNING
 This translation need to be updated. 
WARNING

Procesamiento paralelo

Puedes usar las palabras reservadas fork, fork again y end fork para denotar procesamientos paralelos.

WARNING
 This translation need to be updated. 
WARNING

Split processing

Split

You can use split, split again and end split keywords to denote split processing.

Input split (multi-start)

You can use hidden arrows to make an input split (multi-start):

[Ref. QA-8662]

Output split (multi-end)

You can use kill or detach to make an output split (multi-end):

Notas

Se puede aplicar formato a un texto usando sintaxis de WikiCreole.

Una nota puede ser flotante, usando la palabra clave floating.

*[Ref. [QA-2398](https://forum.plantuml.net/2398/is-it-possible-to-add-a-comment-on-top-of-a-activity-partition?show=2403#a2403)]*

WARNING
 This translation need to be updated. 
WARNING

Colores

Puedes especificar colores en algunas actividades.

*[Ref. [QA-4906](https://forum.plantuml.net/4906/setting-ad-hoc-gradient-backgrounds-in-activity?show=4917#a4917)]*

WARNING
 This translation need to be updated. 
WARNING

Lines without arrows

You can use skinparam ArrowHeadColor none in order to connect activities using lines only, without arrows.

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.

Simple colored arrow [link]

You can use simple colored arrow with the link keyword.

Multiple colored arrow

You can use multiple colored arrow.

[Ref. QA-4411]

Connector (or Circle)

You can use parentheses to denote connector.

Color on connector

You can add color on connector.

[Ref. QA-10077]

And even use style on Circle:

[Ref. QA-19975]

Agrupación

Puedes agrupar actividades definiendo particiones:

*[Ref. [QA-2793](https://forum.plantuml.net/2793/activity-beta-partition-name-more-than-one-word-does-not-work?show=2798#a2798)]* *[Ref. [QA-542](https://forum.plantuml.net/542/ability-to-define-hyperlink-on-diagram-elements?show=14003#c14003)]*

WARNING
 This translation need to be updated. 
WARNING

Carriles

Usando la tecla pipe |, puedes definir carriles.

También es posible cambiar el color de los carriles.

*[Ref. [QA-2681](https://forum.plantuml.net/2681/possible-define-alias-swimlane-place-alias-everywhere-else?show=2685#a2685)]*

WARNING
 This translation need to be updated. 
WARNING

Desacoplar y remover

Es posible remover una flecha usando la palabra reservada detach .

Emoji as action (with icon stereotype)

You can use emoji as action, with the stereotype <<icon>>:

[Ref. GH-2436]

Otras formas de representación de actividades

Cambiando el sepador final, ; , puedes configurar diferentes representaciones para una actividad:

WARNING
 This translation need to be updated. 
WARNING

UML (Unified Modeling Language) Shape (with UML stereotype)

Table of UML Shape Name

Name Stereotype syntax
ObjectNode <<object>>
ObjectNode
typed by signal
<<objectSignal>> or <<object-signal>>
AcceptEventAction
without TimeEvent trigger
<<acceptEvent>> or <<accept-event>>
AcceptEventAction
with TimeEvent trigger
<<timeEvent>> or <<time-event>>
SendSignalAction

SendObjectAction
with signal type
<<sendSignal>> or <<send-signal>>
Trigger <<trigger>>

[Ref. GH-2185]

UML Shape Example using Stereotype

[Ref. GH-2185, QA-16558, GH-1659]

Ejemplo completo

Condition Style

Inside style (by default)

Diamond style

InsideDiamond (or Foo1) style

[Ref. QA-1290 and #400]

Condition End Style

Diamond style (by default)

Horizontal line (hline) style

[Ref. QA-4015]

Using (global) style

Without style (by default)

With style

You can use style to change rendering of elements.

Creole on Activity

You can use Creole or HTML Creole on Activity diagram: