umlstate-machinestatechart

state machine for a cd writer


As a newbie am trying to develop a state machine using Visio for a cd writer. below are the device operations/transactions and attached, is a diagram of what I've done so far, am unsure if its accurately represented.

Device operation 

Solution

  • Visually your diagram looks like a state machine and states have good-sounding names - it's a good start. :)

    The first issue I see there is the transition specification. It is definitely not correct. State transitions in UML are specify in the following format:

    event [guard] /action
    

    where:

    Getting back to your diagram I would say that...

    1. Most of the labels on your transitions should not carry "/" as it indicates an action. There are mostly manual triggers, like "load" (pressing the button to open the drawer), "Cancel", "butn", etc.
    2. Consider some events that are triggered internally, like "burning done", or "CD loaded"
    3. You can add some guard conditions in the situations where possible
    4. I would remove all the triggers with no effect (like cancel with no CD in). It makes the diagram simpler with no loss of information
    5. States LOADED and IDLE in your case are kind of strange, weak. It is not clear what makes them different (see the example below)

    Here is a diagram that I find a bit more accurate (see notes for additional comments):

    enter image description here