액티비티 다이어그램
액티비티 다이어그램은 워크플로 또는 프로세스를 표현합니다. 각 단계, 그 순서, 그리고 분기와 병렬 경로를 기술하며, 업무 프로세스, 알고리즘, 시작에서 끝으로 흐르는 모든 것에 적합합니다. PlantUML에서는 각 액티비티를 한 줄씩 작성하고, 화살표와if, repeat, fork 같은 키워드로 제어 흐름을 표현합니다. 다이어그램은 자동으로 생성됩니다.
- 텍스트 입력, 다이어그램 출력. 분기와 반복을 포함하여, 위에서 아래로 흐름을 기술합니다.
- 위에서 아래로 읽힙니다. 텍스트의 순서가 곧 다이어그램의 순서입니다.
- 재구성이 쉽습니다. 단계의 순서를 바꾸거나 분기를 추가하는 작업은, 그림을 다시 그리는 것이 아니라 텍스트를 편집하는 것으로 끝납니다.
Simple action
Activities label starts with : and ends with ;.
Text formatting can be done using creole wiki syntax.
They are implicitly linked in their definition order.
|
🎉 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]
Start/Stop/End
You can use start and stop keywords to denote the
beginning and the end of a diagram.
|
🎉 Copied!
|
|
You can also use the
end keyword.
|
🎉 Copied!
|
|
Conditional
You can use if, then and else keywords to put tests if your diagram.
Labels can be provided using parentheses.
|
🎉 Copied!
|
|
You can use the
elseif keyword to have several tests :
|
🎉 Copied!
|
|
*[Refs. [QA-3931](https:forum.plantuml.net/3931/please-provide-elseif-structure-vertically-activity-diagrams), [issue-582](https:github.com/plantuml/plantuml/issues/582)]* *[Refs. [QA-3931](https:forum.plantuml.net/3931/please-provide-elseif-structure-vertically-activity-diagrams), [GH-582](https:github.com/plantuml/plantuml/issues/582)]*
WARNING
This translation need to be updated. WARNING
Switch and case [switch, case, endswitch]
You can use switch, case and endswitch keywords to put switch in your diagram.
Labels can be provided using parentheses.
|
🎉 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!
|
|
Repeat loop
Simple repeat loop
You can userepeat and repeat while keywords to have repeat loops.
|
🎉 Copied!
|
|
Repeat loop with repeat action and backward action
It is also possible to use a full action asrepeat target and insert an action in the return path using the backward keyword.
|
🎉 Copied!
|
|
[Ref. QA-5826]
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]
While loop
Simple while loop
You can usewhile and endwhile keywords to have while loop.
|
🎉 Copied!
|
|
It is possible to provide a label after the
endwhile keyword, or using the is keyword.
|
🎉 Copied!
|
|
While loop with backward action
It is also possible to insert an action in the return path using thebackward keyword.
|
🎉 Copied!
|
|
[Ref. QA-11144]
Infinite while loop
If you are usingdetach to form an infinite while loop, then you will want to also hide the partial arrow that results using -[hidden]->
|
🎉 Copied!
|
|
Parallel processing [fork, fork again, end fork, end merge]
You can use fork, fork again and end fork or end merge keywords to denote parallel processing.
Simple fork
|
🎉 Copied!
|
|
fork with end merge
|
🎉 Copied!
|
|
[Ref. QA-5320]
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
[Ref. QA-13731]
Label on end fork (or UML joinspec):
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
[Ref. QA-5346]
Other example
|
🎉 Copied!
|
|
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!
|
|
Notes
Text formatting can be done using creole wiki syntax.
A note can be floating, using floating keyword.
|
🎉 Copied!
|
|
You can add note on backward activity:
|
🎉 Copied!
|
|
[Ref. QA-11788] You can add note on partition activity:
|
🎉 Copied!
|
|
[Ref. QA-2398]
Colors
You can specify a color for some activities.
|
🎉 Copied!
|
|
You can also use gradient color.
|
🎉 Copied!
|
|
[Ref. QA-4906]
Lines without arrows
You can use skinparam ArrowHeadColor none in order to connect activities using lines only, without arrows.
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
Arrows
Using the -> notation, you can add texts to arrow, and change
their color.
It's also possible to have dotted, dashed, bold or hidden arrows.
|
🎉 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]
Grouping or partition
Group
You can group activity together by defining group:
|
🎉 Copied!
|
|
Partition
You can group activity together by defining partition:
|
🎉 Copied!
|
|
It's also possible to change partition color:
|
🎉 Copied!
|
|
[Ref. QA-2793] It's also possible to add link to partition:
|
🎉 Copied!
|
|
[Ref. QA-542]
Group, Partition, Package, Rectangle or Card
You can group activity together by defining:- group;
- partition;
- package;
- rectangle;
- card.
|
🎉 Copied!
|
|
Swimlanes
Using pipe |, you can define swimlanes.
It's also possible to change swimlanes color.
|
🎉 Copied!
|
|
You can add
if conditional or repeat or while loop within swimlanes.
|
🎉 Copied!
|
|
You can also use
alias with swimlanes, with this syntax:
|[#<color>|]<swimlane_alias>| <swimlane_title>
|
🎉 Copied!
|
|
[Ref. QA-2681]
Detach or kill [detach, kill]
It's possible to remove an arrow using the detach or kill keyword:
detach
|
🎉 Copied!
|
|
kill
|
🎉 Copied!
|
|
Emoji as action (with icon stereotype)
You can use emoji as action, with the stereotype <<icon>>:
|
🎉 Copied!
|
|
[Ref. GH-2436]
SDL (Specification and Description Language) (with SDL sterotype)
Table of SDL Shape Name
| Name | Stereotype syntax | Deprecated syntax |
| Input |
<<input>>
|
<
|
| Output |
<<output>>
|
>
|
| Procedure |
<<procedure>>
|
|
|
| Load |
<<load>>
|
\
|
| Save |
<<save>>
|
/
|
| Continuous |
<<continuous>>
|
}
|
| Task |
<<task>>
|
]
|
SDL using stereotype (Current official form)
|
🎉 Copied!
|
|
|
🎉 Copied!
|
|
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]
Complete example
|
🎉 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!
|
|