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语言学习006:歌曲搜索

    #include <stdio.h> #include <string.h> //字符串处理库 ]={ "I left my heart in Harvard Med ...

  2. “Win10 UAP 开发系列”之主题模式切换

    微软动作真是快,本来想写WP8.1RT系列,结果刚整理了一点就出Win10 UAP了.不过还好RT到Win10的差别还不算太大.前两天参加了Win10开发极客秀,虽然没获奖,不过在韦恩卑鄙的帮助下顺利 ...

  3. LeetCode3:Longest Substring Without Repeating Characters

    题目: Given a string, find the length of the longest substring without repeating characters. For examp ...

  4. 【Java每日一题】20161130

    20161129问题解析请点击今日问题下方的"[Java每日一题]20161130"查看 package Nov2016; public class Ques1130 { publ ...

  5. UVA 253 Cube painting

    大致题意:有三种颜色,一个立方体6面都可以涂一种颜色.现在给出两个每个面都涂好颜色的立方体,判断这两个立方体通过旋转是否相等. 立方体的旋转出来的结果有很多,首先可以0,1,2,3,4,5(顺序是:上 ...

  6. 接口测试之webservice

    什么是Webservice Web service是一个平台独立的,低耦合的,自包含的.基于可编程的web的应用程序,可使用开放的XML(标准通用标记语言下的一个子集)标准来描述.发布.发现.协调和配 ...

  7. [AngularJS] 使用AngularCSS动态加载CSS

    [AngularJS] 使用AngularCSS动态加载CSS 前言 使用AngularAMD动态加载Controller 使用AngularAMD动态加载Service 上列两篇文章里,介绍了如何如 ...

  8. css 属性选择器

    css2的属性选择器 1.[class~="flower"]:选中有flower的class class="flower ss" class="ss ...

  9. JS的window.location应用实例

    window.location 对象用于获得当前页面的地址 (URL),并把浏览器重定向到新的页面. Window Locationwindow.location 对象在编写时可不使用 window ...

  10. 用Phaser来制作一个html5游戏——flappy bird (二)

    在上一篇教程中我们完成了boot.preload.menu这三个state的制作,下面我们就要进入本游戏最核心的一个state的制作了.play这个state的代码比较多,我不会一一进行说明,只会把一 ...