Friday 29 September 2023

PlantUML: How to repeat a loop in an activity diagram

Using repeat, repeatwhile keywords, we can repeat a loop in the activity diagram.

loop.txt

@startuml

title "Print the file data to console"

!pragma useVerticalIf on

start

repeat
	:read next 1024 bytes from file into the buffer;
	:print the buffer data to console;
repeat while (have more data?) is (yes)

->no;

stop

@enduml

 

Above snippet generate below diagram.


 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment