@startuml
skin rose
actor 使用者
participant " 头等舱"as A
participant " 第二类"as B
participant " 最后一堂课"as 別的东西
使用者-> A: 完成这项工作
activate A
A -> B: 创建请求
activate B
B -> 別的东西: 创建请求
activate 別的东西
別的东西--> B: 这项工作完成
destroy 別的东西
B --> A: 请求创建
deactivate B
A --> 使用者: 做完
deactivate A
@enduml
示例3
@startuml
skin rose
actor User as user
participant "Browser UI"as browser
participant "Reseller UI"as reseller_ui
user -> browser : Visit the Reseller UI login page
browser -> reseller_ui : Retrieve the Reseller UI login page
browser <- reseller_ui : Return the login page with form field \nusername, password,and One Time Password(OTP)
user <- browser : Display the page, wait for user input
user -> user: Recall username and password \nfrom memory
user -> browser : Fill in the username and password field
user -> user: Open Google Authenticator, \nread the OTP
user -> browser : Fill in the OTP,and hit the send button
browser -> reseller_ui : Send the username, password and OTP
reseller_ui -> reseller_ui : Verify the information is valid
alt Login valid
browser <- reseller_ui : Return the logged in page
user <- browser : Display the logged in page
else Login invalid
browser <- reseller_ui : Return login failure page
user <- browser : Display the login failure page
end
@enduml
用例图
示例4
@startuml
skin rose
left to right direction
actor 消费者
actor 销售员
rectangle 买单 {
消费者 --(买单)(买单).>(付款): include
(帮助).>(买单): extends
(买单)-- 销售员
}@enduml
示例5
@startuml
skin rose
actor User
User ->[API Gateway]: Product Details Page
[API Gateway]-->[Price]: Price information
[API Gateway]-->[Product]:" Product Details"[API Gateway]-->[Inventory]:" In-stock availability"@enduml
示例6
@startuml
skin rose
actor "Developer"<<Person>>as ADEV
actor "Expert"<<Person>>as AEXPR
actor "Subscriber"<<Person>>as ASUBSCR
actor "Workforce"<<Person>>as AWF
actor "Anonymous"<<Person>>as AU
component "Tokyo"<<Software System>>as CQS
usecase (develops and deploys new versions)as UC1
usecase UC2 as "
logins,
manages profile,
reviews and updates quizzes content"
usecase UC3 as "
logins,
manages profile,
receives notifications,
reviews available quizzes,
assigns quiz,
review results,
reports feedback"
usecase UC4 as "
logins,
manages profile,
receives quiz assignments,
passes quizzes"
usecase UC5 as(signs up)
ADEV -down-> UC1
UC1 -down-> CQS
AEXPR -down-> UC2
UC2 -down-> CQS
ASUBSCR -up-> UC3
UC3 -up-> CQS
AWF -up-> UC4
UC4 -up-> CQS
AU -down-> UC5
UC5 -down-> CQS
@enduml
脑图
示例9
@startmindmap
caption Save World Diagram
title Save the World
header
Draft One
endheader
center footer 1 of 3
legend left
|=|= Type ||<back:#FFBBCC> </back>| Problem ||<back:lightgreen></back>| Areas ||<back:Orange></back>| Actions |
endlegend
<style>
mindmapDiagram {.green {
BackgroundColor lightgreen
}.rose {
BackgroundColor #FFBBCC}}</style>* Solving \n Global \n Warming <<rose>>**[#lightgreen] Eating differently***[#Orange] Vegan***[#Orange] Vegetarian***[#Orange] Less processed foods***[#Orange] Buy local food** Travel <<green>>***[#Orange]:Bike more
Skateboard more
Walk more
;***[#Orange]:Ride buses
Ride UBER
Ride carpool
;***[#Orange]:Buy an electric car
Buy an electric scooter
Buy an electric skateboard
;
left side
** Home <<green>>***[#Orange] Energy audit***[#Orange] Use a cloths line***[#Orange] Add insulation***[#Orange] Get solar panels**[#lightgreen] Be a role model***_ Vote
***_ Encourage others
***_ Teach your kids
@endmindmap
泳道图
条件判断
@startuml
skin rose
start
if(Graphviz 已安装?) then (yes):处理所有\n绘制任务;else(no):仅处理
__时序图__ 和 __活动__ 图;
endif
stop
@enduml
多项判断
@startuml
skin rose
start
if(条件 A) then (yes):文本 1;
elseif (条件 B) then (yes):文本 2;
stop
elseif (条件 C) then (yes):文本 3;
elseif (条件 D) then (yes):文本 4;else(nothing):文本 else;
endif
stop
@enduml
示例11:循环图
@startuml
skin rose
title While Loop - Activity Diagram
start
while(Hungry?)is(Yes):Eat Hot Wings;:Drink Homebrew;
endwhile (No):Go To Sleep;
stop
@enduml
示例12:并行处理
@startuml
skin rose
title Parallel - Activity Diagram
start
:Eat Hot Wings;:Drink Homebrew;if(Turn On The Game?) then (yes)
fork
:__Having Fun__!!!;
fork again
:Scream At TV!!;
end fork
else(no):Not Having Fun;:Eat Poptart;
endif
:Go To Bed;
stop
@enduml
示例13:switch分支
@startuml
skin rose
start
switch (测试?)case( 条件 A ):Text 1;case( 条件 B ):Text 2;case( 条件 C ):Text 3;case( 条件 D ):Text 4;case( 条件 E ):Text 5;
endswitch
stop
@enduml
分区活动
@startuml
skin rose
start
partition "**处理** HelloWorld"{
note
这是我的注释
----//Creole 测试//
end note
:Ready;:HelloWorld(i)>:Hello-Sent;}@enduml
类图
示例14
@startuml
skin rose
classCar{
color
model
+start()#run()#stop()}
Car <|- Bus
Car *-down- Tire
Car *-down- Engine
Bus o-down- Driver
@enduml