用例使用圆括号()
包裹,也可以使用关键字usecase
来定义用例,还可以用关键字as
来定义Alias,这个Alias可以在以后定义关系的时候使用。
@startuml
(First Usecase)
(Another Usecase) as (case2)
usecase case3
usecase (Last\nNewCase) as case4
@enduml
First Usecase Another Usecase case3 Last NewCase
用例描述若是要跨越多行,可以用双引号包裹,还可以使用分隔符:
代码 描述
–
横线
..
虚线
==
双横线
__
下划线
@startuml
usecase UC1 as "You can use
several lines to define your usecase.
You can also use separators.
--
Several separators are possible.
==
And you can add titles:
..Conclusion..
This allows large description."
@enduml
You can use several lines to define your usecase. You can also use separators. Several separators are possible. And you can add titles: This allows large description. Conclusion
角色使用两个冒号:
包裹,也可以使用关键字actor
来定义,同样地,也可以使用as
来定义Alias。
@startuml
:First Actor:
:Another\nActor: as Man2
actor Woman3
actor :Last Actor: as Person1
@enduml
First Actor Another Actor Woman3 Last Actor
角色的外观默认为火柴棍人,但是也可以更改成用户头像 样式或者透明人 样式:
@startuml
:Default:
@enduml
@startuml
skinparam actorStyle awesome
:UserAvatar:
@enduml
@startuml
skinparam actorStyle Hollow
:Hollow:
@enduml