project: blog
target: plant-uml-instances.md
date: 2015-12-24
status: publish
tags:
- PlantUML
- UML
categories:
- UML


Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response


actor Foo1
boundary Foo2
control Foo3
entity Foo4
database Foo5
Foo1 -> Foo2 : To boundary
Foo1 -> Foo3 : To control
Foo1 -> Foo4 : To entity
Foo1 -> Foo5 : To database


actor Bob #red
' The only difference between actor
'and participant is the drawing
participant Alice
participant "I have a really\nlong name" as L #99FF99
/' You can also declare:
participant L as "I have a really\nlong name" #99FF99
'/ Alice->Bob: Authentication Request
Bob->Alice: Authentication Response
Bob->L: Log transaction


Alice -> "Bob()" : Hello
"Bob()" -> "This is very\nlong" as Long
' You can also declare:
' "Bob()" -> Long as "This is very\nlong"
Long --> "Bob()" : ok


Alice->Alice: This is a signal to self.\nIt also demonstrates\nmultiline \ntext


Bob ->x Alice
Bob -> Alice
Bob ->> Alice
Bob -\ Alice
Bob \\- Alice
Bob //-- Alice Bob ->o Alice
Bob o\\-- Alice Bob <-> Alice
Bob <->o Alice


Bob -[#red]> Alice : hello
Alice -[#0000FF]->Bob : ok autonumber
Bob -> Alice : Authentication Request
Bob <- Alice : Authentication Response autonumber 15
Bob -> Alice : Another authentication Request
Bob <- Alice : Another authentication Response autonumber 40 10
Bob -> Alice : Yet another authentication Request
Bob <- Alice : Yet another authentication Response autonumber "<b>[000]"
Bob -> Alice : Authentication Request
Bob <- Alice : Authentication Response autonumber 15 "<b>(<u>##</u>)"
Bob -> Alice : Another authentication Request
Bob <- Alice : Another authentication Response autonumber 40 10 "<font color=red><b>Message 0 "
Bob -> Alice : Yet another authentication Request
Bob <- Alice : Yet another authentication Response


title Simple communication example Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response Alice -> Bob : Hello
legend right
Short
legend
endlegend



Alice -> Bob : message 1
Alice -> Bob : message 2 newpage Alice -> Bob : message 3
Alice -> Bob : message 4 newpage A title for the\nlast page Alice -> Bob : message 5
Alice -> Bob : message 6


Alice -> Bob: Authentication Request alt successful case Bob -> Alice: Authentication Accepted else some kind of failure Bob -> Alice: Authentication Failure
group My own label
Alice -> Log : Log attack start
loop 1000 times
Alice -> Bob: DNS Attack
end
Alice -> Log : Log attack end
end else Another type of failure Bob -> Alice: Please repeat end


Alice->Bob : hello
note left: this is a first note Bob->Alice : ok
note right: this is another note Bob->Bob : I am thinking
note left
a note
can also be defined
on several lines
end note


participant Alice
participant Bob
note left of Alice #aqua
This is displayed
left of Alice.
end note note right of Alice: This is displayed right of Alice. note over Alice: This is displayed over Alice. note over Alice, Bob #FFAAAA: This is displayed\n over Bob and Alice. note over Bob, Alice
This is yet another
example of
a long note.
end note

caller -> server : conReq
hnote over caller : idle
caller <- server : conConf
rnote over server
"r" as rectangle
"h" as hexagon
endrnote


participant Alice
participant "The **Famous** Bob" as Bob Alice -> Bob : hello --there--
... Some ~~long delay~~ ...
Bob -> Alice : ok
note left
This is **bold**
This is //italics//
This is ""monospaced""
This is --stroked--
This is __underlined__
This is ~~waved~~
end note Alice -> Bob : A //well formatted// message
note right of Alice
This is <back:cadetblue><size:18>displayed</size></back>
__left of__ Alice.
end note
note left of Bob
<u:red>This</u> is <color #118888>displayed</color>
**<color purple>left of</color> <s:red>Alice</strike> Bob**.
end note
note over Alice, Bob
<w:#FF33FF>This is hosted</w> by <img sourceforge.jpg>
end note



== Initialization ==

Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response == Repetition == Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response


participant Alice
actor Bob ref over Alice, Bob : init Alice -> Bob : hello ref over Bob
This can be on
several lines
end ref


Alice -> Bob: Authentication Request
...
Bob --> Alice: Authentication Response
...5 minutes latter...
Bob --> Alice: Bye !


Alice -> Bob: message 1
Bob --> Alice: ok
|||
Alice -> Bob: message 2
Bob --> Alice: ok
||45||
Alice -> Bob: message 3
Bob --> Alice: ok


participant User User -> A: DoWork
activate A A -> B: << createRequest >>
activate B B -> C: DoWork
activate C
C --> B: WorkDone
destroy C B --> A: RequestCreated
deactivate B A -> User: Done
deactivate A


participant User User -> A: DoWork
activate A #FFBBBB A -> A: Internal call
activate A #DarkSalmon A -> B: << createRequest >>
activate B B --> A: RequestCreated
deactivate B
deactivate A
A -> User: Done
deactivate A


Bob -> Alice : hello create Other
Alice -> Other : new create control String
Alice -> String
note right : You can also put notes! Alice --> Bob : ok


[-> A: DoWork activate A A -> A: Internal call
activate A A ->] : << createRequest >> A<--] : RequestCreated
deactivate A
[<- A: Done
deactivate A


[-> Bob
[o-> Bob
[o->o Bob
[x-> Bob [<- Bob
[x<- Bob Bob ->]
Bob ->o]
Bob o->o]
Bob ->x] Bob <-]
Bob x<-]

@startuml

/'
This is an example Sequence diagram
Showing a fictional web feature flow
It is easy to see roles & responsibilities for each component
and easy to change them too...
'/ title "Story Feature Example - Sequence Diagram" 'This is a single line comment /'
This is a multi-line comment
One another line
'/ actor User
'boundary Proxy
participant UIServer as UI
participant API User -> UI: LINK: goto /account page
activate UI
UI -> User:
deactivate UI activate User
note over User
Requirments:
UI: Setting Page
Click delete button
end note ' user requests account/delete page
User -> UI: /account/delete
deactivate User
activate UI
UI -> User:
deactivate UI ' confirmation form
activate User
note over User
UI: Form
Are you sure?
end note User -> UI: POST /account/delete
deactivate User
activate UI note over UI: Verify: user has confirmed
UI -> API: /account/delete
activate API
API -> API: delete
API -> UI: done
deactivate API
UI -> User: success
deactivate UI @enduml

PlantUML的实例参考的更多相关文章

  1. SQL/T-SQL实例参考

    ,D.[Score] B_Score ,'Distince'= CASE WHEN C.Score > D.Score THEN C.[Score] - D.[Score] WHEN C.Sco ...

  2. [AS3]as3用ByteArray来对SWF文件编码加密实例参考

    [AS3]as3用ByteArray来对SWF文件编码加密实例参考,简单来说,就是将 swf 以 binary 的方式读入,并对 ByteArray 做些改变,再重新存成 swf 档.这个作业当然也可 ...

  3. SQL/T-SQL实例参考-2

    对多关联查询,查询多中的记录,但是返回一的结果集 子查询语法 --一对多关联查询,查询多中的记录,但是返回一的结果集 SELECT C.* FROM ( SELECT A.BasicID FROM [ ...

  4. SQL/T-SQL实例参考-1

    CASE ,D.[Score] B_Score ,'Distince'= CASE WHEN C.Score > D.Score THEN C.[Score] - D.[Score] WHEN ...

  5. Centos7 Firewall 防火墙配置应用实例参考(转)

    时间:2016-06-02 02:40来源:linux.it.net.cn 作者:IT   简单的配置,参考学习:--permanent  当设定永久状态时 在命令开头或者结尾处加入此参数,否则重载或 ...

  6. ncl 实例参考

    NCL中绘制中国任意省份的精确地图 NCL学习笔记(实战篇) 用NCL画垂直风场剖面图实例 NCL学习笔记(天气分析图)

  7. R语言画图实例-参考R语言实战

    dose <- c(, , , ,) drugA <- c(, , , , ) drugB <- c(, , , , ) # 数据准备 opar <- par(no.reado ...

  8. PlantUML——4.实例演示1

    给自己发消息 @startuml Alice -> Alice : This is a signal to self.\nIt also demonstrates \nmultiline tex ...

  9. python搭建简易服务器实例参考

    有关python搭建简易服务器的方法. 需求分析: 省油宝用户数 已经破了6000,原有的静态报表 已经变得臃肿不堪, 每次打开都要缓上半天,甚至浏览器直接挂掉 采用python搭建一个最最简易的 w ...

随机推荐

  1. C语言学习015:联合(union)与枚举(enum)

    联合 联合和结构的区别是,结构会为每个字段申请一片内存空间,而联合只是申请了一片内存空间然后所有字段都会保存到这片空间中,这片空间的大小由字段中最长的决定,下面我们就开始定义一个联合 //联合的定义 ...

  2. foreach DataTable或Table时要略过第一行。

    昨天有续写一个练习<输入数字动态创建行(二)>http://www.cnblogs.com/insus/p/4916260.html ,最终是需要把数据存入数据库中. 在循环ASP:Tab ...

  3. Java总结篇系列:Java多线程(二)

    本文承接上一篇文章<Java总结篇系列:Java多线程(一)>. 四.Java多线程的阻塞状态与线程控制 上文已经提到Java阻塞的几种具体类型.下面分别看下引起Java线程阻塞的主要方法 ...

  4. C#/.NET 基础学习

    初识C# C#是微软公司发布的面向对象的.运行于.NET Framework之上的高级程序设计语言.与Java有着明显不同,借鉴Delphi的特点,与COM(组件对象模型)直接集成,是微软公司 .NE ...

  5. 广义表 Head Tail

    head:取非空广义表的第一个元素 tail:取非空广义表除第一个元素外剩余元素构成的广义表 L=((x,y,z),a,(u,t,w)) head(L)为(x,y,z) head(head(L))为x ...

  6. PHP程序员7小时学会Kotlin系列 - 第一小时 背景

    基础知识 Kotlin简单的说是Java语言的改良版本,是一种静态类型编程语言,可运行于JVM.Andoid或JavaScript环境,于2016年2月15日发布1.0正式版.Kotlin定位于一门通 ...

  7. Scalaz(45)- concurrency :Task-函数式多线程编程核心配件

    我们在上一节讨论了scalaz Future,我们说它是一个不完善的类型,最起码没有完整的异常处理机制,只能用在构建类库之类的内部环境.如果scalaz在Future类定义中增加异常处理工具的话,用户 ...

  8. 从源码角度理清memcache缓存服务

    memcache作为缓存服务器,用来提高性能,大部分互联网公司都在使用.   前言    文章的阅读的对象是中高级开发人员.系统架构师. 本篇文章,不是侧重对memcache的基础知识的总结,比如se ...

  9. Guava学习笔记:Guava新增集合类型-Multiset

    Guava引进了JDK里没有的,但是非常有用的一些新的集合类型.所有这些新集合类型都能和JDK里的集合平滑集成.Guava集合非常精准地实现了JDK定义的接口.Guava中定义的新集合有: Multi ...

  10. percona server 5.7.16正式发布

    继2016年10月12日mysql 5.7.16发布后,percona server 5.7.16终于于11月29日发布了,这是最新版本的5.7系列,可从https://www.percona.com ...