基本语法
每个普通节点:冒号开头,分号结尾
活动图的起始和结尾:start、end或stop
start
:case1;
:case2;
end
条件语句
start
if(predicate?) then (yes)
:case yes;
else (no)
:case no;
endif
end
多重条件语句
plaintUML里没有switch语法,只能使用elseif代替
start
note right:多分支条件语句,实现switch
if (condition A) then (yes)
:Text 1;
elseif (condition B) then (yes)
:Text 2;
stop
elseif (condition C) then (yes)
:Text 3;
elseif (condition D) then (yes)
:Text 4;
else (nothing)
:Text else;
endif
stop
do while循环
start
note right:do while循环
repeat
:read data;
:generate diagrams;<