4

I'm trying to model the following: When filling out a submission form, the system automatically saves the users progress every 5 minutes.

This is what I tried, but I don't think it's correct.

In my case the condition is asked only after the "fill submission" activity is finished. Also I don't want to indicate, that the user is starting the "fill submission" activity again.

stuckoverflow
  • 625
  • 2
  • 7
  • 23
Karandash_
  • 65
  • 6

1 Answers1

2

You would use an interruptible region represented by a dashed line box:

enter image description here

The timer interrupt appears independently and intrerrupts the current action. Auto save is executed and comes back with Fill form. Resuming Fill form need a bit of thought since usually you have some entry code which must not be executed in case of a continuation. That might be a bit more tricky as you would likely need a mutex for that.

UML 2.5 has a detailed description in chap. 15.6.3.2 Interruptible Activity Regions on pp. 405.


Just a word about your approach. The save is only executed when the form is closed. So if it takes longer than 5 minutes you end up in your form again which is likely not desired :-)

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • 1
    I do see the logic behind your approach, but doesn't the interruption still end the fill form activity? You resume it (as do i in my approach), but to me it looks like the fill form activity is starting from new. edit: i don't need to program it, i only need to model it. – Karandash_ Jan 23 '21 at 22:15
  • Yes and no. The action is interrupted and starts from the beginning after the save is done. So if you have some initialization is must be done only once on first entry. That can be achieved with a mutex. This is the (as said) tricky part. Usually you can get by with a note about that condition since coders will anyway have to think about how to solve that. – qwerty_so Jan 23 '21 at 22:22
  • 1
    But if the action is interrupted, wouldn't that mean that the user is no longer in the view where he fills out the form? – Karandash_ Jan 23 '21 at 22:32
  • There's nothing said about the view. And it unreasonable. When your computer does computation you still see what is on the monitor, don't you? It's just that he has no control over I/O while auto-save. And that should not take ages (another note or place for extensive modeling). Otherwise: White man staring on sand watch. – qwerty_so Jan 23 '21 at 22:37
  • I think my problem is that i've only ever used interruptions to initiate a new activity, where the user is presented with a new view (when applying the model to a website), but your argumentation does make sense to me :) Thanks! – Karandash_ Jan 23 '21 at 22:51