2

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.

Community
  • 1
  • 1
mmierins
  • 3,674
  • 4
  • 21
  • 25

3 Answers3

1

This seems not appropriate for a useful activity diagram:

Of course, the button can be clicked without entering the value into the input box.

Then there was no noteworthy activity, so nothing to model.

Another possibility is that user exits the application right after opening it.

Same here.

Most aspects of UML are rather GUI-unaware. You want to not spend your time modeling trivial cases but instead focus on actual workflows. Such diagrams will add way more value.

Nevertheless if you were to model something for your example, your assumption is basically right. The input validation is not bound to the willing user decision of leaving an input blank, though. You gotta do it anyway.

observer
  • 2,925
  • 1
  • 19
  • 38
  • If the button is clicked without entering input values then error message is displayed i.e. there is something to model. Also if user exits the application he/she reaches activity exit point and of course this is something that has to be displayed in the model. – mmierins Jan 14 '15 at 12:18
0

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

Vladimir
  • 2,066
  • 15
  • 13
-1

It's a very interesting question. As already said in the previous post, a UI typically receive events and send informations in a visual form. So, the particular UML actions (activity diagram) like "accept event" and "signal sending" are appropriate when the UI can receive different s events in no predefine order. Activity diagram are generally based on a "scenario" point of view, showing some scenarios but not all. Make events oriented activity diagram is more difficult; sometimes, "interruption region" have to be used.

Alan Allen
  • 71
  • 5