I am trying to design an activity diagram (UML) for a networked tic tac toe game that I developed, with sockets. I am using activity partitions (swimlanes). So, there is three partitions: Client1, Server, and Client2.
The diagram is looking good, except I do not know how to represent loop structures.
If you look at this link: activity diagram, and look at the last diagram on the page (Partition), that is the type of activity diagram that I am working with.
Does anyone know how I can represent loops? Thanks!
Two possible representation of the loop in the UML activity diagram - a) shows loop where the condition is checked before the action is taken and b) shows the loop where the loop condition is checked after taking action.
To show a loop, you use the loop operand with a single fragment and put the basis of the iteration in the guard. For conditional logic, you can use an alt operator and put a condition on each fragment. Only the fragment whose guard is true will execute. If you have only one region, there is an opt operator.
Yes, there may be cases where multiple endpoints are acceptable. It is possible for an activity diagram to show multiple final states.
Look further down the page you link to for Expansion Region. Use one with the iterative keyword.
An expansion region is a structured activity region that executes multiple times. Input and output expansion nodes are drawn as a group of three boxes representing a multiple selection of items. The keyword "iterative", "parallel" or "stream" is shown in the top left corner of the region.
Maybe I'm missing something but why not just using the exit flow of the last activity in the loop as input flow for the first activity in the loop (with a guard condition to finish the loop when appropriate)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With