Maintenance

Cleaning

The sequence of the cleaning steps depends on which parts of the machine are dirty and needs go get cleaned.

@startuml

participant "Remote Controller" as remote
participant "Coffee Machine" as cm
actor User

note over remote, cm
**product_id**, **order_id** depends what the client is going to order, because of that they are not specified in this diagram
is_cancel_allowed, is_confirm_allowed, is_cancelled, is_confirmed are not specified because we suggest that the client 
end note

remote -> cm: start_cleaning {}
activate cm
cm -> remote: cleaning_started {response_code} {order_id}

cm -> remote : order_changed {dispenser:""} {order_id} {product_id} {status:"Processing"} ... \n{action: {"context":"Cleaning"}, {"action":**"InsertMilkCleaningTablet"**}} 
User -> cm: User inserted milk cleaning tablet

cm -> remote : order_changed {dispenser:""} {order_id} {product_id} {status:"Processing"} ... \n{action: {"context":"Cleaning"}, {"action":"Running"}} {additional_information: {{"key": Progress"}, {"value_double": ...}, {"key": MaintenancePhase"}, {"value_string":"Automatic"}}}

cm -> remote : order_changed {dispenser:""} {order_id} {product_id} {status:"Processing"} ... \n{action: {"context":"Cleaning"}, {"action":"Poured"}} {additional_information: {"key":"Progress"}, {"value_double":100.0}}


cm -> remote : order_changed {dispenser:""} {order_id} {product_id} {status:"Processing"} ... \n{action: {"context":"Cleaning"}, {"action":"Finished"}} {additional_information: {"key":"Progress"}, {"value_double":100.0}}

cm -> remote : order_changed {dispenser:""} {order_id} {product_id} {status:**"Done"**}
deactivate cm

== Cleaning gets cancelled ==

cm -> remote : order_changed {dispenser:""} {order_id} {product_id} {status:**"Cancel"**}

== Cleaning failed ==

cm -> remote : order_changed {dispenser:""} {order_id} {product_id} {status:**"Failed"**}

@enduml