Diagrama de actividad (nueva sintaxis)
La sintaxis anterior utilizada para los diagramas de actividad presentaba varias limitaciones y problemas de mantenimiento. Reconociendo estos inconvenientes, hemos introducido una sintaxis e implementación totalmente renovadas que no sólo son fáciles de usar, sino también más estables.Ventajas de la nueva sintaxis
- Sin dependencia de Graphviz: Al igual que con los diagramas de secuencia, la nueva sintaxis elimina la necesidad de instalar Graphviz, simplificando así el proceso de configuración.
- Facilidad de mantenimiento: La * naturaleza intuitiva de la nueva sintaxis significa que es más fácil de manejar y mantener sus diagramas.
Transición a la Nueva Sintaxis
Mientras que continuaremos apoyando la sintaxis antigua para mantener la compatibilidad, animamos a los usuarios a migrar a la nueva sintaxis para aprovechar las características mejoradas y los beneficios que ofrece. Haga el cambio hoy y experimente un proceso de diagramación más ágil y eficiente con la nueva sintaxis de diagrama de actividad.
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.
|
🎉 Copied!
|
|
Other simple action (defined as a list)
Simple action list separated by -
|
🎉 Copied!
|
|
Simple action list separated by *
With one level
|
🎉 Copied!
|
|
With several levels
|
🎉 Copied!
|
|
[Ref. GH-2376]
Inicio/Parada/Fin
Puede utilizar las palabras clave start y stop para indicar el
inicio y el final de un diagrama.
|
🎉 Copied!
|
|
También puede utilizar la palabra clave
end.
|
🎉 Copied!
|
|
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:
if (...) then (...) ... [else (...) ...] endif
|
🎉 Copied!
|
|
if (...) is (...) then ... [else (...) ...] endif
|
🎉 Copied!
|
|
if (...) equals (...) then ... [else (...) ...] endif
|
🎉 Copied!
|
|
[Ref. QA-301]
Condicionales anidadas (modo horizontal)
Puede utilizar la palabra claveelseif para tener varias condicionales anidadas (por defecto, es el modo horizontal):
|
🎉 Copied!
|
|
Condicionales anidadas (modo vertical)
Puede utilizar el comando!pragma useVerticalIf on para tener las condicionales anidadas en modo vertical:
|
🎉 Copied!
|
|
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.
|
🎉 Copied!
|
|
Conditional with stop on an action [kill, detach]
You can stop action on a if loop.
|
🎉 Copied!
|
|
But if you want to stop at the precise action, you can use the
kill or detach keyword:
kill
|
🎉 Copied!
|
|
[Ref. QA-265]
detach
|
🎉 Copied!
|
|
El ciclo Repeat
Puedes usar las palabras reservadas repeat y repeatwhile para colocar bucles.
|
🎉 Copied!
|
|
It is also possible to use a full action as
repeat target and insert an action in the return path using the backward keyword.
|
🎉 Copied!
|
|
*[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.
|
🎉 Copied!
|
|
[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:
label <label_name>goto <label_name>
|
🎉 Copied!
|
|
[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.
|
🎉 Copied!
|
|
Es posible proporcionar una etiqueta después de la palabra reservada
endwhile, o usar la palabra reservada is .
|
🎉 Copied!
|
|
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.
|
🎉 Copied!
|
|
WARNING
This translation need to be updated. WARNING
Split processing
Split
You can usesplit, split again and end split keywords to denote split processing.
|
🎉 Copied!
|
|
Input split (multi-start)
You can usehidden arrows to make an input split (multi-start):
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
[Ref. QA-8662]
Output split (multi-end)
You can usekill or detach to make an output split (multi-end):
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
Notas
Se puede aplicar formato a un texto usando sintaxis de WikiCreole.
Una nota puede ser flotante, usando la palabra clave floating.
|
🎉 Copied!
|
|
*[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.
|
🎉 Copied!
|
|
*[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.
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
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.
|
🎉 Copied!
|
|
Simple colored arrow [link]
You can use simple colored arrow with the link keyword.
|
🎉 Copied!
|
|
Multiple colored arrow
You can use multiple colored arrow.
|
🎉 Copied!
|
|
[Ref. QA-4411]
Connector (or Circle)
You can use parentheses to denote connector.
|
🎉 Copied!
|
|
Color on connector
You can add color on connector.
|
🎉 Copied!
|
|
[Ref. QA-10077] And even use style on Circle:
|
🎉 Copied!
|
|
[Ref. QA-19975]
Agrupación
Puedes agrupar actividades definiendo particiones:
|
🎉 Copied!
|
|
*[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.
|
🎉 Copied!
|
|
*[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 .
|
🎉 Copied!
|
|
Emoji as action (with icon stereotype)
You can use emoji as action, with the stereotype <<icon>>:
|
🎉 Copied!
|
|
[Ref. GH-2436]
Otras formas de representación de actividades
Cambiando el sepador final, ; , puedes configurar diferentes representaciones para una actividad:
|<>/]}
|
🎉 Copied!
|
|
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>>
|
UML Shape Example using Stereotype
|
🎉 Copied!
|
|
[Ref. GH-2185, QA-16558, GH-1659]
Ejemplo completo
|
🎉 Copied!
|
|
Condition Style
Inside style (by default)
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
Diamond style
|
🎉 Copied!
|
|
InsideDiamond (or Foo1) style
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
[Ref. QA-1290 and #400]
Condition End Style
Diamond style (by default)
- With one branch
|
🎉 Copied!
|
|
- With two branches (
B1,B2)
|
🎉 Copied!
|
|
Horizontal line (hline) style
- With one branch
|
🎉 Copied!
|
|
- With two branches (
B1,B2)
|
🎉 Copied!
|
|
[Ref. QA-4015]
Using (global) style
Without style (by default)
|
🎉 Copied!
|
|
With style
You can use style to change rendering of elements.
|
🎉 Copied!
|
|
Creole on Activity
You can use Creole or HTML Creole on Activity diagram:
|
🎉 Copied!
|
|