アクティビティ図(新しい構文)
現在のアクティビティ図(アクティビティ図)構文は、維持するのが困難コードのような多くの制限および欠点を有します。
だから、最初のV7947からの新しい、より良い構文およびユーザが利用できるソフトウェア(ベータ版)を提案しました。
シーケンス図のように、新しいソフトウェアのもう一つの利点は、それがもはやGraphvizのに依存しているということではありません。
新しい構文は、古い構文に置き換えられます。ただし、互換性を考えると、古い構文は、まだ確実にするために使用することができ、下位互換性を。
しかし、私たちは、新しい構文を使用することをユーザーに促します。
シンプルなアクティビティ図
アクティビティ]タブ(アクティビティ・ラベル)は、コロン、セミコロンで始まります。
テキスト形式のサポートクレオールウィキ構文。
ライン上のデフォルトのインストール活動は、彼らが接続されている順序で定義されました。
@startuml
:Hello world;
:This is on defined on
several **lines**;
@enduml
開始/終了
あなたは、キーワードを使用することができますstart
し、stop
開始と終了を示す示しています。
@startuml
start
:Hello world;
:This is on defined on
several **lines**;
stop
@enduml
また、使用することができます end
キーワードを。
@startuml
start
:Hello world;
:This is on defined on
several **lines**;
end
@enduml
条件文
イラストでは、キーワードを使用することができif
、then
かつelse
テストブランチを設定します。カッコ内寸法テキスト。
@startuml
start
if (Graphviz installed?) then (yes)
:process all\ndiagrams;
else (no)
:process only
__sequence__ and __activity__ diagrams;
endif
stop
@enduml
また、キーワードを使用することができますelseif
複数のブランチテストアップセットを。
@startuml
start
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
@enduml
繰り返しサイクル
あなたは、キーワードを使用することができますrepeat
し、repeatwhile
サイクルを繰り返します。
@startuml
start
repeat
:read data;
:generate diagrams;
repeat while (more data?)
stop
@enduml
whileループ
あなたは、キーワードを使用することができますwhile
し、end while
ループしながら行っています。
@startuml
start
while (data available?)
:read data;
:generate diagrams;
endwhile
stop
@enduml
また、することができますキーワードendwhile
の追加吹き出した後、キーワードを使用する方法がありますis
。
@startuml
while (check filesize ?) is (not empty)
:read file;
endwhile (empty)
:close file;
@enduml
並列処理
あなたは、キーワードを使用することができfork
、fork again
およびend fork
並列処理を表します。
@startuml
start
if (multiprocessor?) then (yes)
fork
:Treatment 1;
fork again
:Treatment 2;
end fork
else (monoproc)
:Treatment 1;
:Treatment 2;
endif
@enduml
コメント= =
テキスト形式のサポートクレオールウィキ構文。
ノートは使用して、浮動することができます floating
キーワードを。
@startuml
start
:foo1;
floating note left: This is a note
:foo2;
note right
This note is on several
//lines// and can
contain <b>HTML</b>
====
* Calling the method ""foo()"" is prohibited
end note
stop
@enduml
=色=
あなたは活動(アクティビティ)のいずれかを指定することができます色を。
@startuml
start
:starting progress;
#HotPink:reading configuration files
These files should edited at this point!;
#AAAAAA:ending of the process;
@enduml
=アロー=
使用し->
たマーカーを、テキストを追加したり、矢印矢印を変更することができます色を。
また、あなたは点状(点線)、ストリップ(破線)、または暗黙の太い矢印を選択することができます
@startuml
:foo1;
-> You can put text on arrows;
if (test) then
-[#blue]->
:foo2;
-[#green,dashed]-> The text can
also be on several lines
and **very** long...;
:foo3;
else
-[#black,dotted]->
:foo4;
endif
-[#gray,bold]->
:foo5;
@enduml
コネクタ(コネクタ)
あなたは、コネクタを定義するために括弧を使用することができます。
@startuml
start
:Some activity;
(A)
detach
(A)
:Other activity;
@enduml
コンビネーション(グループ化)
パーティション(パーティション)を定義することによって、あなたは一緒にアクティブな組み合わせ(グループ)の複数を置くことができます。
@startuml
start
partition Initialization {
:read config file;
:init internal variable;
}
partition Running {
:wait for user interaction;
:print information;
}
stop
@enduml
レーン(スイムレーン)
あなたは、パイプを使用することができ|
レーンを定義します。
また、レーン変更することができます色を。
@startuml
|Swimlane1|
start
:foo1;
|#AntiqueWhite|Swimlane2|
:foo2;
:foo3;
|Swimlane1|
:foo4;
|Swimlane2|
:foo5;
stop
@enduml
セパレート(切り離し)
あなたは、キーワードを使用することができますdetach
矢印を削除します。
@startuml
:start;
fork
:foo1;
:foo2;
fork again
:foo3;
detach
endfork
if (foo4) then
:foo5;
detach
endif
:foo6;
detach
:foo7;
stop
@enduml
言語の特別な領域(SDL)
エンド・デリミタ(ATアクティブなタブのセミコロンを変更することによって;
)、異なる形状は、イベントのために提供されてもよいです。
|
<
>
/
]
}
@startuml
:Ready;
:next(o)|
:Receiving;
split
:nak(i)<
:ack(o)>
split again
:ack(i)<
:next(o)
on several line|
:i := i + 1]
:ack(o)>
split again
:err(i)<
:nak(o)>
split again
:foo/
split again
:i > 5}
stop
end split
:finish;
@enduml
完全な例
@startuml
start
:ClickServlet.handleRequest();
:new page;
if (Page.onSecurityCheck) then (true)
:Page.onInit();
if (isForward?) then (no)
:Process controls;
if (continue processing?) then (no)
stop
endif
if (isPost?) then (yes)
:Page.onPost();
else (no)
:Page.onGet();
endif
:Page.onRender();
endif
else (false)
endif
if (do redirect?) then (yes)
:redirect process;
else
if (do forward?) then (yes)
:Forward request;
else (no)
:Render page template;
endif
endif
stop
@enduml