Search code examples
umlmodeling

How-to model user interaction with GUI controls in UML activity diagram?


Imagine that you have a simplistic GUI application. When you open it, there is an input box and a button placed on the application window. When you press the button you should see the entered value displayed in a popup message box. Of course, the button can be clicked without entering the value into the input box. Another possibility is that user exits the application right after opening it. How-do you model this in UML activity diagram? The typical UML elements like a) decision node b) fork/join node do not seem appropriate to me.

According to my understanding a) is used when a check on certain set property is made and according to the outcome, the flow is routed somewhere; this is not appropriate since no checks are made b) is not appropriate since it assumes parallel execution (?) which is not the case in the modeled situation.

There is a similar question here on SO though I don't understand what is meant by the suggested "Event element" in the accepted answer.


Solution

  • It is possible. Use call operation for operation invocation on classes instance which represent GUI elements and also use Accpet Event Actions to receive events from GUI elements.GUI elements should be defined as standard classes. See Action Model part in UML Superstructure document. UML Website