Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

PlantUMLのActive図記法が新しくなってました

いまでもアクセスのあるPlantUMLの記事
shuzo-kino.hateblo.jp


最近のマネジメントタスク増量に合わせて、
改めて公式を見直したところ……なんかすごいのがありました。

既存のものもアップデートがかかっており、
スクリプト言語めいた様式だったActiveが新しいフォーマットに
New Activity Diagram Beta syntax and features

更新ログをみると以下の通り。
上記記事は2013年10月なのでほぼ1年後にでた新機能ですね

24 Aug, 2014: Many new activity diagrams features.

今までの様式だったらすごいことになってた以下のような例が
f:id:shuzo_kino:20180601235427p:plain

こう書けます

@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

参考もと

plantuml.com