PlantUML一些例子

直接上一些例子

@startuml
Alice -> Bob ++ #Blue : 认证请求
Bob -> Alice ++ : 认证失败
group 我自己的标签 [我自己的标签2]
    Alice -> Log : 开始记录攻击日志
    loop 1000次
        Alice -> Bob: DNS攻击
    end
    Alice -> Log : 结束记录攻击日志
end
@enduml


@startumlactor 
角色activate 对象1
角色 -> 对象1
对象1 -> 对象2: 同步消息
对象2 --> 对象1 : 返回消息1
对象1 o-> 对象2 : 异步消息
对象1 -> 对象1 : 自关联消息
@enduml

@startuml
participant Participant as Foo
actor       Actor       as Foo1
boundary    Boundary    as Foo2
control     Control     as Foo3
entity      Entity      as Foo4
database    Database    as Foo5
collections Collections as Foo6
queue       Queue       as Foo7
Foo -> Foo1 : To actor 
Foo -> Foo2 : To boundary
Foo -> Foo3 : To control
Foo -> Foo4 : To entity
Foo -> Foo5 : To database
Foo -> Foo6 : To collections
Foo -> Foo7: To queue
@enduml

@startuml
'actor 和 participant 只在外观上有区别'
actor       Bob #red
participant Alice
participant "很长很长很长\n的名字" as L #99FF99
/' 也可以这样声明:
    participant L as "很长很长很长\n的名字" #99FF99
'/
Alice  -> Bob : 认证请求
Bob -> Alice : 认证响应
Bob -> L : 记录事务日志
@enduml


@startuml
participant DefaultBeanDefinitionDocumentReader as p1
participant BeanDefinitionParserDelegate as p2
participant BeanDefinitionReaderUtils as p3
participant XmlReaderContext as p4
 
p1 -> p1 : 1 processBeanDefinition(ele, delegate)
p1 -> p2 : 1.1 parseBeanDefinitionElement(ele)
p2 --> p1 : 1.2 bdHolder:BeanDefinitionHolder
opt [bdHolder!=null]
    p1 -> p2 : 1 decorateBeanDefinitionInRequired(ele, bdHolder)
    p2 --> p1 : 2 bdHolder:BeanDefinitionHolder
    p1 -> p3 : 3 registerBeanDefinition(bdHolder, getReaderContext().getRegistry())
    p1 -> p4 : 4 fireComponentRegistered(new BeanComponentDefinition(bdHolder))
end
 
@enduml

@startuml
start
:"盲僧刷完先锋去上路Gank";
:"打好标记,叫己方上路石头人去勾引对面诺手";
if ("判定 瞎子+石头人 是否打赢了 敌方诺手") then (true)
    :"乘势放先锋吃一血塔";
else
    :"上野联动,一死一送。";
    if ("判定盲僧是否有大赏金(1000块)") then (true)
        :"对面人头狗直接起飞";
    endif
endif
stop
@enduml


@startuml
title The withdrawal amount is greater than the threshold of currency. Manual withdrawal sequence diagram\n
skinparam sequenceArrowThickness 1
skinparam roundcorner 20
'skinparam maxmessagesize 60
skinparam backgroundColor #fff
skinparam handwritten false
skinparam dpi 100
skinparam sequence {
    ArrowColor black
    ActorBorderColor #000
    LifeLineBorderColor black
    LifeLineBackgroundColor #CCC
    ParticipantBorderColor #000
    ParticipantBackgroundColor default
    'ParticipantFontName Impact
    ParticipantFontSize 14
    ParticipantFontColor #000
    ActorFontColor black
    ActorFontSize 14
    'ActorFontName Aapex
}
skinparam activity{
  ArrowFontSize 14
  FontSize 14
}
autonumber
box "Client Side"
    actor User as user
    participant "Web Front" as front
    participant "User Center Application" as uc #ccc
end box
Database "Database" as db
box "Admin Side"
    participant "Web Admin Application" as admin
    actor "Admin User" as adminer
end box

user -> front: open withdraw page
front -> front: user fill in withdrawal parameters
front -> uc: send withdrawal application
note right of uc: withdrawal amount is greater than\n the threshold of currency
uc->db:save withdrawal application
db->uc:response
uc-->front:response to web front,\n application status is processing.
' adminer operation
==  ==
adminer->admin:open withdrawal audit page
admin->db:query unapproved records
db->admin: response unapproved records
admin->admin:audit record
admin->db:update status of record,\n status is waiting
db->admin: response update result
note right of admin:Manual processing of account information\nand get transaction id
admin->admin:fill in transaction id, and confirm withdrawal.
admin->db:update account information
db->admin:response result.
==  ==
user->front:open withdrawal page
front->uc:query withdrawal progress
uc->db:get progress of \n withdrawal
db->uc:response staus of withdrawal
uc->front:response staus of withdrawal
@enduml






@startuml
hide footbox 
title Sequence 
actor User #Blue
User->A
note left: Note on left
[o->A: message
activate A
note right: 生命线
A->B: message
deactivate A
activate B
note right: Note on right
B-->A: message
deactivate B
activate A
A->A: message
activate A
deactivate A
deactivate A
A->o C
note right: 箭头样式
A-[#blue]>C
note right: 箭头颜色
alt AD
    A->D: message
else DA
    A->D: message
end
note over D #FFAAAA: 组合消息
D->E:message
note right: Creole和HTML
note right of E
  This is **bold**
  This is //italics//
  This is ""monospaced""
  This is --stroked--
  This is __underlined__
  This is ~~waved~~
end note
== 分隔符 ==
E->F: message
...
note over A:延迟
F->A:message
box "包裹参与者DEF" #LightBlue
    participant D
    participant E
    participant F
end box
@enduml
  • 9
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值