Hi guys, I'm trying to draw UML state machine, but seems to me there are 100 ways the task can be done and understood, I would really appreciate if you can check this and warn me about errors if I made some?
Task: - the vending machine receives 1,2 and 5 $, the price of drink is 2 $
- it dispenses the drink if enough money is entered and refunds change
- machine has power on and power off)
If I understand the principle, on the arrows there should be written:
trigger event
[condition if it exists] /
action
I marked each state and transitions the numbers (STATES = s1,2 ..., TRANSITIONS = p1,2 ...)
to make it easier to answer without drawing
(eg "p1 is wrong, there should be written this" etc)
I should lhave this task solved in 24 hrs. so I would be very grateful for your feedback. Thanks in advance!
PS
1.) Does it eventually return to IDLE which seems to me more logical,
or it must go to the final state (rounded black point) as power off?
Or can there be two final states, so the S5 goes to another final state?
2.) should it be after P3 or P4 maybe two branches?
i.e. a new branch where the exact price amount is inserted (so there is no need for refund )
- if so, where to put it?