Search code examples
umldiagramactivity-diagram

Loop in a activity diagram


I am trying to design an activity diagram for an image editing application. Let's say that the application has one adjustment to edit an image. that's brightness. When the user opens the application he can change the brightness again and again. Then finally save it. That's really not a loop. but it's a repetitive process. How can I represent such a process. I have found stack answers for looping through documents and for loops. But didn't found a matching scenario for like this.

Thank you!


Solution

  • Oh, but why do you say it is not a loop? It is.

    Sorry, no reasonable drawing tool at hand, so this will be textual

    Let's look at a pseudocode:

    open app (image as attribute)
    while decide to continue to brighten the image do
        brighten the image
    loop
    

    As you can see you do loop and your condition to loop or finish it depends on the decision to brighten or finish working with the app.

    The brightening itself can be more complex (e.g. may have some selection of settings like level or method of brightening, it may even have the ability to break the brightenin or undoing) but it is still the loop.

    Out of this solution to represent a loop you can use options 2 and 3 easily.