示例1
@startumlskin roseparticipant terminalbox "Crédit Chaton" participant acquisition as acqChatonparticipant autorisation as authChatonend boxparticipant interbancairebox "Bénépé" participant acquisition as acqBéparticipant autorisation as authBéend boxterminal -> acqChaton : demandeacqChaton -> interbancaire :demandeinterbancaire -> acqBé : demandeacqBé -> authBé : demandeauthBé --> acqBé : réponseacqBé --> interbancaire : réponseinterbancaire --> acqChaton : réponseacqChaton --> terminal : réponse
@enduml
示例2
@startumlskin roseactor 使用者participant " 头等舱" as Aparticipant " 第二类" as Bparticipant " 最后一堂课" as 別的东西使用者-> A: 完成这项工作activate AA -> B: 创建请求activate BB -> 別的东西: 创建请求activate 別的东西別的东西--> B: 这项工作完成destroy 別的东西B --> A: 请求创建deactivate BA --> 使用者: 做完deactivate A@enduml
示例3
@startumlskin roseactor User as userparticipant "Browser UI" as browserparticipant "Reseller UI" as reseller_uiuser -> browser : Visit the Reseller UI login pagebrowser -> reseller_ui : Retrieve the Reseller UI login pagebrowser <- reseller_ui : Return the login page with form field \nusername, password, and One Time Password(OTP)user <- browser : Display the page, wait for user inputuser -> user: Recall username and password \nfrom memoryuser -> browser : Fill in the username and password fielduser -> user: Open Google Authenticator, \nread the OTPuser -> browser : Fill in the OTP, and hit the send buttonbrowser -> reseller_ui : Send the username, password and OTPreseller_ui -> reseller_ui : Verify the information is validalt Login validbrowser <- reseller_ui : Return the logged in pageuser <- browser : Display the logged in pageelse Login invalidbrowser <- reseller_ui : Return login failure pageuser <- browser : Display the login failure pageend
@enduml
用例图
示例4
@startumlskin roseleft to right directionactor 消费者actor 销售员rectangle 买单 {消费者 -- (买单)(买单) .> (付款) : include(帮助) .> (买单) : extends(买单) -- 销售员}@enduml
示例5
@startumlskin roseactor UserUser -> [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 roseactor "Developer" <<Person>> as ADEVactor "Expert" <<Person>> as AEXPRactor "Subscriber" <<Person>> as ASUBSCRactor "Workforce" <<Person>> as AWFactor "Anonymous" <<Person>> as AUcomponent "Tokyo" <<Software System>> as CQSusecase (develops and deploys new versions) as UC1usecase 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-> UC1UC1 -down-> CQSAEXPR -down-> UC2UC2 -down-> CQSASUBSCR -up-> UC3UC3 -up-> CQSAWF -up-> UC4UC4 -up-> CQSAU -down-> UC5UC5 -down-> CQS@enduml
脑图
示例9
@startmindmapcaption Save World Diagram
title Save the Worldheader
Draft One
endheadercenter footer 1 of 3legend left
|= |= Type |
|<back:
|<back:lightgreen> </back>| Areas |
|<back:Orange> </back>| Actions |
endlegend<style>
mindmapDiagram {.green {BackgroundColor lightgreen}.rose {BackgroundColor }
}
</style>* Solving \n Global \n Warming <<rose>>**[
***[
***[
***[
***[
** Travel <<green>>
***[
Skateboard more
Walk more
;
***[
Ride UBER
Ride carpool
;
***[
Buy an electric scooter
Buy an electric skateboard
;left side** Home <<green>>
***[
***[
***[
***[
**[
***_ Vote
***_ Encourage others
***_ Teach your kids@endmindmap
条件判断
@startuml
skin rosestartif (Graphviz 已安装?) then (yes):处理所有\n绘制任务;
else (no):仅处理__时序图__ 和 __活动__ 图;
endifstop@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 rosetitle While Loop - Activity Diagram startwhile (Hungry?) is (Yes):Eat Hot Wings;:Drink Homebrew;endwhile (No):Go To Sleep;stop@enduml
示例12:并行处理
@startuml
skin rosetitle 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 forkelse (no):Not Having Fun;:Eat Poptart;endif:Go To Bed;stop@enduml
示例13:switch分支
@startuml
skin rosestartswitch (测试?)case ( 条件 A ):Text 1;case ( 条件 B ) :Text 2;case ( 条件 C ):Text 3;case ( 条件 D ):Text 4;case ( 条件 E ):Text 5;endswitchstop
@enduml
分区活动
@startuml
skin rose
start
partition "**处理** HelloWorld" {note这是我的注释----//Creole 测试//end note:Ready;:HelloWorld(i)>:Hello-Sent;
}
@enduml
类图
示例14
@startumlskin roseclass Car {colormodel+start()}Car <|- BusCar *-down- TireCar *-down- EngineBus o-down- Driver@enduml