1.3 在参与者中使用非字母符号

关键字用于改变参与者的先后顺序 。
你也可以使用其它关键字来声明参与者:
@startumlactor Foo1boundary Foo2control Foo3entity Foo4database Foo5collections Foo6Foo1 -> Foo2 : To boundaryFoo1 -> Foo3 : To controlFoo1 -> Foo4 : To entityFoo1 -> Foo5 : To databaseFoo1 -> Foo6 : To collections@enduml
关键字 as 用于重命名参与者
你可以使用 RGB 值或者颜色名修改actor或参与者的背景颜色 。
@startumlactor Bob #red' The only difference between actor'and participant is the drawingparticipant Aliceparticipant "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 RequestBob->Alice: Authentication ResponseBob->L: Log transaction@enduml
您可以使用关键字 order 自定义顺序来打印参与者 。
@startumlparticipant Last order 30participant Middle order 20participant First order 10@enduml
1.3 在参与者中使用非字母符号
你可以使用引号定义参与者,还可以用关键字as 给参与者定义别名 。
Alice -> "Bob()" : Hello"Bob()" -> "This is very\nlong" as Long' You can also declare:' "Bob()" -> Long as "This is very\nlong"Long --> "Bob()" : ok
1.4 给自己发消息
参与者可以给自己发信息,
消息文字可以用 \n来换行 。
@startumlAlice --> Alice: This is a signal to self.\nIt also demonstrates\nmultiline \ntext@enduml
1.5 修改箭头样式
修改箭头样式的方式有以下几种:
@startumlBob ->x AliceBob -> AliceBob ->> AliceBob -\ AliceBob \\- AliceBob //-- AliceBob ->o AliceBob o\\-- AliceBob <-> AliceBob <->o Alice@enduml
1.6 修改箭头颜色
你可以用以下记号修改箭头的颜色:
@startumlBob -[#red]> Alice : helloAlice -[#0000FF]->Bob : ok@enduml
1.7 对消息序列编号
关键字用于自动对消息编号 。
@startumlautonumberBob -> Alice : Authentication RequestBob <- Alice : Authentication Response@enduml
语句start用于指定编号的初始值,而 start可以同时指定编号的初始值和每次增加的值 。
@startumlautonumberBob -> Alice : Authentication RequestBob <- Alice : Authentication Responseautonumber 15Bob -> Alice : Another authentication RequestBob <- Alice : Another authentication Responseautonumber 40 10Bob -> Alice : Yet another authentication RequestBob <- Alice : Yet another authentication Response@enduml
@startumlautonumber "[000]"Bob -> Alice : Authentication RequestBob <- Alice : Authentication Responseautonumber 15 "(##)"Bob -> Alice : Another authentication RequestBob <- Alice : Another authentication Responseautonumber 40 10 "Message 0 "Bob -> Alice : Yet another authentication RequestBob <- Alice : Yet another authentication Response@enduml
你还可以用语句stop 和来表示暂停或继续使用自
动编号 。
1.8 Page Title,and

1.3 在参与者中使用非字母符号

文章插图
The titleis used to add a title to the page.
@startumlheader Page Headerfooter Page %page% of %lastpage%title Example TitleAlice -> Bob : message 1Alice -> Bob : message 2@enduml
1.9 分割示意图 (可分多个图)