Author Topic: Start Activity with the press of a botton  (Read 11950 times)

BiSb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Start Activity with the press of a botton
« on: March 02, 2023, 07:29:17 pm »
Hi everyone,

I have question how to model the activation of a system in an Activity Diagram. The system should start up if a button is pressed or a charger is connected. Intuitively I would model the Activity like this:



But in this case, the Activity would have no Initial Node. Is this allowed according to the UML/SysML spec? My second thought was to use Guards:



The third possibility, I could think about, was using Actions like this:



The first alternative feels most right for me, but I'm not sure. How would you model it?

Greetings
Sebastian




Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8064
  • Karma: +118/-20
    • View Profile
Re: Start Activity with the press of a botton
« Reply #1 on: March 03, 2023, 08:19:48 am »
First thing I'd like to point out,

UML 2.5.1 15.5.3.1
Quote
An ExecutableNode shall not execute until all incoming ControlFlows (if any) are offering tokens.

So currently according to UML your system is currently starting only when the button is pressed and the charger is connected. To get it to work when either occurs, add a decision from the toolbox (EA uses it for MergeNode as well) The two incoming flows go into that and a single outgoing flow goes out.

'Figure 16.41 Implicitly enabled AcceptEventAction' shows that Accept Event Actions can be implicitly enabled on the start of the activity. So if you add the MergeNode as described above it should describe what you're wanting.

BiSb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Start Activity with the press of a botton
« Reply #2 on: March 03, 2023, 06:25:23 pm »
Hi Eve.

Thanks for your reply. First of all, numbered my Alternatives in my text contrary to the titles of the diagrams. My preferred Alternative was the diagram "Alternative 3" and not "Alternative 1". To my shame I forget the basic rule, you mentioned:

UML 2.5.1 15.5.3.1
Quote
An ExecutableNode shall not execute until all incoming ControlFlows (if any) are offering tokens.

Following your advice a good solution would look like this:



Right?

Greetings
Sebastian

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Start Activity with the press of a botton
« Reply #3 on: March 03, 2023, 08:26:44 pm »
That would be fine.

q.

BiSb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Start Activity with the press of a botton
« Reply #4 on: March 03, 2023, 08:55:58 pm »
Thanks again. I guess you will see more topics, created by me, in the future.  ;D

jfzouain

  • EA User
  • **
  • Posts: 151
  • Karma: +6/-1
    • View Profile
Re: Start Activity with the press of a botton
« Reply #5 on: March 05, 2023, 06:41:52 am »
HI BiSb

I have an eBook how to create Activity Diagram and Use Cases with EA, highly recommend it.

Look for it at Leanpub.com

https://leanpub.com/uml-erpworkshop
Best regards

Jose Zouain